xref: /haiku/src/system/kernel/listeners.cpp (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include <listeners.h>
7 
8 
9 WaitObjectListenerList gWaitObjectListeners;
10 spinlock gWaitObjectListenerLock = B_SPINLOCK_INITIALIZER;
11 
12 
13 WaitObjectListener::~WaitObjectListener()
14 {
15 }
16 
17 
18 /*!	Add the given wait object listener. gWaitObjectListenerLock lock must be
19 	held.
20 */
21 void
22 add_wait_object_listener(struct WaitObjectListener* listener)
23 {
24 	gWaitObjectListeners.Add(listener);
25 }
26 
27 
28 /*!	Remove the given wait object listener. gWaitObjectListenerLock lock must be
29 	held.
30 */
31 void
32 remove_wait_object_listener(struct WaitObjectListener* listener)
33 {
34 	gWaitObjectListeners.Remove(listener);
35 }
36