Detecter sigwait pour les threads POSIX (Cygwin ne l'a pas)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5759 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
3195a6f480
commit
608f3e8db5
|
@ -1067,6 +1067,10 @@ if ./hasgot -i pthread.h $pthread_link pthread_self; then
|
|||
esac
|
||||
echo "Options for linking with POSIX threads: $pthread_link"
|
||||
echo "PTHREAD_LINK=$pthread_link" >> Makefile
|
||||
if sh ./hasgot $pthread_link sigwait; then
|
||||
echo "sigwait() found"
|
||||
echo "#define HAS_SIGWAIT" >> s.h
|
||||
fi
|
||||
else
|
||||
echo "POSIX threads not found."
|
||||
fi
|
||||
|
|
|
@ -779,6 +779,7 @@ int caml_threadstatus_wait (value wrapper)
|
|||
|
||||
value caml_wait_signal(value sigs) /* ML */
|
||||
{
|
||||
#ifdef HAS_SIGWAIT
|
||||
sigset_t set;
|
||||
int retcode, signo;
|
||||
|
||||
|
@ -793,6 +794,10 @@ value caml_wait_signal(value sigs) /* ML */
|
|||
leave_blocking_section();
|
||||
caml_pthread_check(retcode, "Thread.wait_signal");
|
||||
return Val_int(signo);
|
||||
#else
|
||||
invalid_argument("Thread.wait_signal not implemented");
|
||||
return Val_int(0); /* not reached */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Error report */
|
||||
|
|
Loading…
Reference in New Issue