xref: /haiku/src/system/kernel/listeners.cpp (revision a7ccfc910c82763236c8a4093d803d9464e350db)
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 
~WaitObjectListener()13 WaitObjectListener::~WaitObjectListener()
14 {
15 }
16 
17 
18 /*!	Add the given wait object listener. gWaitObjectListenerLock lock must be
19 	held.
20 */
21 void
add_wait_object_listener(struct WaitObjectListener * listener)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
remove_wait_object_listener(struct WaitObjectListener * listener)32 remove_wait_object_listener(struct WaitObjectListener* listener)
33 {
34 	gWaitObjectListeners.Remove(listener);
35 }
36