further support for threads.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@647 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
5a5c674300
commit
5fd92de03b
6
C/save.c
6
C/save.c
@ -553,10 +553,12 @@ do_save(int mode) {
|
|||||||
static Int
|
static Int
|
||||||
p_save(void)
|
p_save(void)
|
||||||
{
|
{
|
||||||
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (NOfThreads != 1) {
|
if (NOfThreads != 1) {
|
||||||
Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running");
|
Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
which_save = 1;
|
which_save = 1;
|
||||||
return(do_save(DO_EVERYTHING));
|
return(do_save(DO_EVERYTHING));
|
||||||
}
|
}
|
||||||
@ -565,10 +567,12 @@ p_save(void)
|
|||||||
static Int
|
static Int
|
||||||
p_save2(void)
|
p_save2(void)
|
||||||
{
|
{
|
||||||
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (NOfThreads != 1) {
|
if (NOfThreads != 1) {
|
||||||
Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running");
|
Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
which_save = 2;
|
which_save = 2;
|
||||||
return(do_save(DO_EVERYTHING) && unify(ARG2,MkIntTerm(1)));
|
return(do_save(DO_EVERYTHING) && unify(ARG2,MkIntTerm(1)));
|
||||||
}
|
}
|
||||||
@ -1507,10 +1511,12 @@ p_restore(void)
|
|||||||
int mode;
|
int mode;
|
||||||
|
|
||||||
Term t1 = Deref(ARG1);
|
Term t1 = Deref(ARG1);
|
||||||
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (NOfThreads != 1) {
|
if (NOfThreads != 1) {
|
||||||
Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running");
|
Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (!GetName(FileNameBuf, YAP_FILENAME_MAX, t1)) {
|
if (!GetName(FileNameBuf, YAP_FILENAME_MAX, t1)) {
|
||||||
Error(TYPE_ERROR_LIST,t1,"restore/1");
|
Error(TYPE_ERROR_LIST,t1,"restore/1");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
Reference in New Issue
Block a user