Recursive mutex can be locked multiple times by a single thread they are initialitzed by lumiera_recmutex_init() and used by LUMIERA_RECMUTEX_* macros. Chained mutex use the mutexacquirer from the outer scope now. Maybe its later needed to pass acquirers explicit, we will see.
59 lines
1 KiB
Text
59 lines
1 KiB
Text
|
|
TESTING "Locking" ./test-locking
|
|
|
|
TEST "mutex section" mutexsection <<END
|
|
out: mutex locked section 1
|
|
out: mutex locked section 2
|
|
END
|
|
|
|
|
|
TEST "mutex not unlocked asserts" mutexforgotunlock <<END
|
|
return: 134
|
|
END
|
|
|
|
|
|
TEST "nested mutex section" nestedmutexsection <<END
|
|
out: outer mutex locked section
|
|
out: inner mutex locked section
|
|
END
|
|
|
|
|
|
TEST "chained mutex section" chainedmutexsection <<END
|
|
out: outer mutex locked section
|
|
out: inner but not outer mutex locked section
|
|
END
|
|
|
|
|
|
TEST "recursive mutex section" recursivemutexsection <<END
|
|
out: mutex locked once
|
|
out: mutex locked twice
|
|
END
|
|
|
|
|
|
TEST "rwlock section" rwlocksection <<END
|
|
out: write locked section 1
|
|
out: read locked section 2
|
|
END
|
|
|
|
|
|
TEST "rwlock not unlocked asserts" rwlockforgotunlock <<END
|
|
return: 134
|
|
END
|
|
|
|
|
|
TEST "condition not unlocked asserts" conditionforgotunlock <<END
|
|
return: 134
|
|
END
|
|
|
|
TEST "condition section" conditionsection <<END
|
|
out: condition locked section 1
|
|
out: condition locked section 2
|
|
END
|
|
|
|
PLANNED "condition signaling" <<END
|
|
END
|
|
|
|
PLANNED "condition broadcasting" <<END
|
|
END
|
|
|
|
|