* 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:
Axel Dörfler 2008-11-05 11:05:02 +00:00
parent c068350a89
commit 11ab7172d9

View File

@ -1313,6 +1313,11 @@ _mutex_trylock(mutex *mutex)
status_t
_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;
do {
status = acquire_sem((sem_id)mutex->waiters);