Use unnamed semaphore of Grand Central Dispatch for macOS.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 29 Nov 2016 02:21:15 +0000 (11:21 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 29 Nov 2016 02:28:33 +0000 (11:28 +0900)
commit8f486d084a0e4d9409fb93809ec5b3bf820f343b
tree81f10a796b04588a954670109664ea0ddc101622
parent8071e2d8df33b0d4c0f9c3b9e597a4da91ea9629
Use unnamed semaphore of Grand Central Dispatch for macOS.

* configure.ac [*-apple-darwin*]: Search dispatch_semaphore_create
and define HAVE_LIB_DISPATCH if found.
* src/npth.c [HAVE_LIB_DISPATCH] (sem_init, sem_post, sem_wait): New.
* src/npth.c (try_sem_open): Remove.
* tests/t-fork.c: Add comments.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
configure.ac
src/npth.c
tests/t-fork.c