2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
5 Desc: Search a semaphore by name
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 #include "exec_intern.h"
14 #include "exec_debug.h"
16 /*****************************************************************************
20 AROS_LH1(struct SignalSemaphore
*, FindSemaphore
,
23 AROS_LHA(CONST_STRPTR
, name
, A1
),
26 struct ExecBase
*, SysBase
, 99, Exec
)
29 Find a semaphore with a given name in the system global semaphore list.
30 Note that this call doesn't arbitrate for the list - use Forbid() to
34 name - Pointer to name.
37 Address of semaphore structure found or NULL.
49 ******************************************************************************/
53 struct SignalSemaphore
*retVal
;
55 /* Nothing spectacular - just look into the list */
56 #if defined(__AROSEXEC_SMP__)
57 EXEC_SPINLOCK_LOCK(&PrivExecBase(SysBase
)->SemListSpinLock
, NULL
, SPINLOCK_MODE_READ
);
59 retVal
= (struct SignalSemaphore
*)FindName(&SysBase
->SemaphoreList
,name
);
60 #if defined(__AROSEXEC_SMP__)
61 EXEC_SPINLOCK_UNLOCK(&PrivExecBase(SysBase
)->SemListSpinLock
);