* Make static initializers sort of work in the test environment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28511 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1313,6 +1313,11 @@ _mutex_trylock(mutex *mutex)
|
|||||||
status_t
|
status_t
|
||||||
_mutex_lock(mutex *mutex, bool threadsLocked)
|
_mutex_lock(mutex *mutex, bool threadsLocked)
|
||||||
{
|
{
|
||||||
|
if (mutex->waiters == NULL) {
|
||||||
|
// MUTEX_INITIALIZER has been used; this is not thread-safe!
|
||||||
|
mutex_init(mutex, mutex->name);
|
||||||
|
}
|
||||||
|
|
||||||
status_t status;
|
status_t status;
|
||||||
do {
|
do {
|
||||||
status = acquire_sem((sem_id)mutex->waiters);
|
status = acquire_sem((sem_id)mutex->waiters);
|
||||||
|
|||||||
Reference in New Issue
Block a user