ccl
ccl copied to clipboard
Add COUNT to SIGNAL-SEMAPHORE
Forked from https://github.com/Clozure/ccl/issues/308
The CCL Lisp function signal-semaphore calls a C function:
https://github.com/Clozure/ccl/blob/275105afd94706d95ac955178316074931822c42/lisp-kernel/thread_manager.c#L529-L533
The macro SEM_RAISE is platform-dependent and implemented here:
https://github.com/Clozure/ccl/blob/275105afd94706d95ac955178316074931822c42/lisp-kernel/threads.h#L119-L142
The Windows ReleaseSemaphore has a count argument that we can directly pass. The Linux and Darwin semaphores don't, however; if would require rewriting the macro to call the actual release function in a C loop or to call a C function that performs the looping.
Related: https://github.com/Clozure/ccl/pull/310