ccl icon indicating copy to clipboard operation
ccl copied to clipboard

Add COUNT to SIGNAL-SEMAPHORE

Open phoe opened this issue 5 years ago • 1 comments

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.

phoe avatar May 10 '20 09:05 phoe

Related: https://github.com/Clozure/ccl/pull/310

Slids avatar May 11 '20 01:05 Slids