protect signal handling with locks for threaded version.

fix close/1 entry in manual (obs from Nicos).
fix -f option in chr Makefile.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2201 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2008-04-03 13:26:38 +00:00
parent 708e69a670
commit 78d7105c16
7 changed files with 50 additions and 16 deletions

View File

@@ -2513,6 +2513,9 @@ static Int
p_first_signal(void)
{
LOCK(SignalLock);
#ifdef THREADS
pthread_mutex_lock(&(ThreadHandle[worker_id].tlock));
#endif
/* always do wakeups first, because you don't want to keep the
non-backtrackable variable bad */
if (ActiveSignals & YAP_WAKEUP_SIGNAL) {
@@ -2586,6 +2589,9 @@ p_first_signal(void)
return Yap_unify(ARG1, MkAtomTerm(Yap_LookupAtom("sig_statistics")));
}
UNLOCK(SignalLock);
#ifdef THREADS
pthread_mutex_unlock(&(ThreadHandle[worker_id].tlock));
#endif
return FALSE;
}
@@ -2632,6 +2638,9 @@ p_continue_signals(void)
if (ActiveSignals & YAP_STATISTICS_SIGNAL) {
Yap_signal(YAP_STATISTICS_SIGNAL);
}
#ifdef THREADS
pthread_mutex_unlock(&(ThreadHandle[worker_id].tlock));
#endif
return TRUE;
}