X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fdarwin-os.c;h=fbbae266e20a2cd7099e62a21200290741f6a9a7;hb=bb9b382751d808c76592ce2484c33f8447db6568;hp=df53e9878ded2a3f5124f6c7e6898c368b3544d0;hpb=d1942842cebf682ea4161792b2920eec7ccfe179;p=sbcl.git diff --git a/src/runtime/darwin-os.c b/src/runtime/darwin-os.c index df53e98..fbbae26 100644 --- a/src/runtime/darwin-os.c +++ b/src/runtime/darwin-os.c @@ -164,13 +164,15 @@ mach_fork() { return pid; } } +#endif void darwin_init(void) { +#ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER setup_mach_exception_handling_thread(); +#endif } -#endif #ifdef LISP_FEATURE_SB_THREAD @@ -193,11 +195,19 @@ os_sem_wait(os_sem_t *sem, char *what) switch (ret) { case KERN_SUCCESS: return; + /* It is unclear just when we can get this, but a sufficiently + * long wait seems to do that, at least sometimes. + * + * However, a wait that long is definitely abnormal for the + * GC, so we complain before retrying. + */ case KERN_OPERATION_TIMED_OUT: fprintf(stderr, "%s: os_sem_wait(%p): %s", what, sem, strerror(errno)); + /* This is analogous to POSIX EINTR. */ + case KERN_ABORTED: goto restart; default: - lose("%s: os_sem_wait(%p): %s", what, sem, strerror(errno)); + lose("%s: os_sem_wait(%p): %lu, %s", what, sem, ret, strerror(errno)); } }