freebsd)
printf ' :elf' >> $ltf
printf ' :freebsd' >> $ltf
- printf ' :sb-pthread-futex' >> $ltf
printf ' :gcc-tls' >> $ltf
if [ $sbcl_arch = "x86" ]; then
printf ' :restore-tls-segment-register-from-context' >> $ltf
#ifdef __FreeBSD__
#include <sys/sysctl.h>
+#if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_SB_PTHREAD_FUTEX)
+#include <sys/umtx.h>
+#endif
static void freebsd_init();
#endif /* __FreeBSD__ */
}
#endif /* LISP_FEATURE_X86 */
}
+
+#if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_SB_PTHREAD_FUTEX)
+int
+futex_wait(int *lock_word, long oldval, long sec, unsigned long usec)
+{
+ struct timespec timeout;
+ int ret;
+
+again:
+ if (sec < 0)
+ ret = umtx_wait((void *)lock_word, oldval, NULL);
+ else {
+ timeout.tv_sec = sec;
+ timeout.tv_nsec = usec * 1000;
+ ret = umtx_wait((void *)lock_word, oldval, &timeout);
+ }
+
+ switch (ret) {
+ case 0:
+ return 0;
+ case ETIMEDOUT:
+ return 1;
+ case EINTR:
+ /* spurious wakeup from interrupt */
+ goto again;
+ default:
+ /* EWOULDBLOCK and others, need to check the lock */
+ return -1;
+ }
+}
+
+int
+futex_wake(int *lock_word, int n)
+{
+ return umtx_wake((void *)lock_word, n);
+}
+#endif
#endif /* __FreeBSD__ */
#ifdef LISP_FEATURE_DARWIN
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.9.63"
+"1.0.9.64"