aka-mj / go-semaphore

Go wrapper of Linux named userspace semaphores
MIT License
10 stars 4 forks source link

enhancement: TimedWait should do a blocking wait #1

Open pvbouwel opened 7 months ago

pvbouwel commented 7 months ago

Nice library and seems to be close to what I need so thanks for opensourcing this.

Is there and particular reason the times wait doesn't use sem_timedwait? It seems the semantics of sem_timedwait are more interesting since and availability of the semaphore would be Picked up. With your golang implementation you try, wait and then try again but that means it is Lively you wait unnecessarily.

pvbouwel commented 7 months ago

Let me know if you are interested in contributions. It would looks something along the lines of https://github.com/pvbouwel/go-semaphore/commit/939bc6d78d0045981a7b419110878902b346b8be