]> git.corax.cc Git - toolbox/commit
include/mutex: Prevent children from unlocking their parents' mutexes
authorMatthias Kruk <m@m10k.eu>
Tue, 20 Apr 2021 23:28:34 +0000 (08:28 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 20 Apr 2021 23:28:34 +0000 (08:28 +0900)
commit97f5763dcd6c4669ff9d53af5df2ad7893aec9f5
treef6782a32b5a7a2eab106d63a22d35801d9d2b2f1
parent7af7283f56eb96d5604bc8d7648639ab935258ad
include/mutex: Prevent children from unlocking their parents' mutexes

The mutex_trylock() and mutex_unlock() functions use $$ to determine the
current process's PID. However, this variable always reflects the PID of
the original shell. This commit changes the functions to use $BASHPID to
determine the PID of the current shell.
include/mutex.sh