semaphore
semaphore copied to clipboard
Revise `call_linksafe/3` to keep track of multiple procs per semaphore
Before, call_linksafe/3
used an ETS set to store a single PID per semaphore key, which does not allow for appropriate sweeping when a semaphore is acquired by more than one process at once.
The linksafe table has been changed to an ETS bag (multiple unique PIDs per semaphore key), along with appropriate related changes. The function test has also been extended to ensure correct behavior in the normal case, as well as when multiple dead procs require sweeping.