]> git.corax.cc Git - toolbox/commit
include/mutex: Use inotifywait to improve performance
authorMatthias Kruk <m@m10k.eu>
Thu, 15 Apr 2021 23:46:33 +0000 (08:46 +0900)
committerMatthias Kruk <m@m10k.eu>
Thu, 15 Apr 2021 23:46:33 +0000 (08:46 +0900)
commitb7ae89d8c1147e1ae7d2c176aa7ab902c951102c
tree398e48d52b1f93a4fd9dbd4282c7d7c288fe7bd9
parenteb3d6f97936dce487812464bda03de139a3eae8c
include/mutex: Use inotifywait to improve performance

The current mutex implementation uses sleep to periodically check if
the lock can be acquired. This causes a lot of latency for short waits
and a lot of unnecessary sleep/wakeup cycles for long waits.
This commit changes the mutex implementation to use inotifywait
instead of sleep, increasing mutex performance for both short and long
waits.
include/mutex.sh