]> git.corax.cc Git - toolbox/commit
include/mutex: Use $$ instead of $BASHPID to identify the owner
authorMatthias Kruk <m@m10k.eu>
Mon, 14 Feb 2022 10:52:14 +0000 (19:52 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 14 Feb 2022 10:52:14 +0000 (19:52 +0900)
commit9a2c3df836641d552e6223fafe623e7e9e95819d
tree4ef9ff3d9c281f5c27f9f37b161bddbacb0503ea
parentd2acee68f4648cec849079ad3f7695c4a8170b01
include/mutex: Use $$ instead of $BASHPID to identify the owner

The mutex module uses $BASHPID to identify the owner of a mutex,
causing scripts to be unable to unlock a mutex that was created in a
subshell (which is what happens when using the ipc module).

This commit changes the mutex module to use $$ to identify the owner
of a mutex, allowing child processes to unlock their parent's mutexes
and vice-versa.
include/mutex.sh