Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / thread / unlockmutex.c
blob616728a8ab3c8fcf8f3ca7e84af2c980bc45e3fe
1 /*
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.
8 */
10 #include "thread_intern.h"
12 #include <exec/semaphores.h>
13 #include <proto/exec.h>
14 #include <assert.h>
16 /*****************************************************************************
18 NAME */
19 AROS_LH1(void, UnlockMutex,
21 /* SYNOPSIS */
22 AROS_LHA(void *, mutex, A0),
24 /* LOCATION */
25 struct ThreadBase *, ThreadBase, 14, Thread)
27 /* FUNCTION
28 Unlocks a locked mutex.
30 INPUTS
31 mutex - mutex to unlock.
33 RESULT
34 This function always succeeds.
36 NOTES
38 EXAMPLE
39 UnlockMutex(mutex);
41 BUGS
43 SEE ALSO
44 CreateMutex(), DestroyMutex(), LockMutex(), TryLockMutex()
46 INTERNALS
47 Mutexes are implemented as thin wrappers around Exec semaphores.
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 assert(mutex != NULL);
55 ReleaseSemaphore((struct SignalSemaphore *) mutex);
57 AROS_LIBFUNC_EXIT
58 } /* UnlockMutex */