2 * thread.library - threading and synchronisation primitives
4 * Copyright © 2007 Robert Norris
6 * This program is free software; you can redistribute it and/or modify it
7 * under the same terms as AROS itself.
10 #include "thread_intern.h"
12 #include <exec/semaphores.h>
13 #include <proto/exec.h>
16 /*****************************************************************************
19 AROS_LH1(void, LockMutex
,
22 AROS_LHA(void *, mutex
, A0
),
25 struct ThreadBase
*, ThreadBase
, 12, Thread
)
28 Locks a mutex. If the lock is already held, this function blocks.
31 mutex - mutex to lock.
34 This function always succeeds.
44 CreateMutex(), DestroyMutex(), TryLockMutex(), UnlockMutex()
47 Mutexes are implemented as thin wrappers around Exec semaphores.
49 *****************************************************************************/
53 assert(mutex
!= NULL
);
55 ObtainSemaphore((struct SignalSemaphore
*) mutex
);