diff --git a/headers/private/kernel/listeners.h b/headers/private/kernel/listeners.h index 6406435325..4db1d5b4c0 100644 --- a/headers/private/kernel/listeners.h +++ b/headers/private/kernel/listeners.h @@ -80,7 +80,7 @@ struct WaitObjectListener : DoublyLinkedListLinkImpl { typedef DoublyLinkedList WaitObjectListenerList; extern WaitObjectListenerList gWaitObjectListeners; -extern spinlock gWaitObjectListenerLock; +extern rw_spinlock gWaitObjectListenerLock; template @@ -89,7 +89,7 @@ NotifyWaitObjectListeners(void (WaitObjectListener::*hook)(Parameter1), Parameter1 parameter1) { if (!gWaitObjectListeners.IsEmpty()) { - InterruptsSpinLocker locker(gWaitObjectListenerLock); + InterruptsReadSpinLocker locker(gWaitObjectListenerLock); WaitObjectListenerList::Iterator it = gWaitObjectListeners.GetIterator(); while (WaitObjectListener* listener = it.Next()) @@ -105,7 +105,7 @@ NotifyWaitObjectListeners( Parameter1 parameter1, Parameter2 parameter2) { if (!gWaitObjectListeners.IsEmpty()) { - InterruptsSpinLocker locker(gWaitObjectListenerLock); + InterruptsReadSpinLocker locker(gWaitObjectListenerLock); WaitObjectListenerList::Iterator it = gWaitObjectListeners.GetIterator(); while (WaitObjectListener* listener = it.Next()) diff --git a/src/system/kernel/debug/system_profiler.cpp b/src/system/kernel/debug/system_profiler.cpp index 431d7ab553..3e94c79263 100644 --- a/src/system/kernel/debug/system_profiler.cpp +++ b/src/system/kernel/debug/system_profiler.cpp @@ -321,7 +321,7 @@ SystemProfiler::~SystemProfiler() // stop wait object listening if (fWaitObjectNotificationsRequested) { - InterruptsSpinLocker locker(gWaitObjectListenerLock); + InterruptsWriteSpinLocker locker(gWaitObjectListenerLock); remove_wait_object_listener(this); } @@ -514,7 +514,7 @@ SystemProfiler::Init() scheduler_add_listener(this); fSchedulerNotificationsRequested = true; - InterruptsSpinLocker waitObjectLocker(gWaitObjectListenerLock); + InterruptsWriteSpinLocker waitObjectLocker(gWaitObjectListenerLock); add_wait_object_listener(this); fWaitObjectNotificationsRequested = true; waitObjectLocker.Unlock(); diff --git a/src/system/kernel/listeners.cpp b/src/system/kernel/listeners.cpp index 61941ff120..0fd752d116 100644 --- a/src/system/kernel/listeners.cpp +++ b/src/system/kernel/listeners.cpp @@ -7,7 +7,7 @@ WaitObjectListenerList gWaitObjectListeners; -spinlock gWaitObjectListenerLock = B_SPINLOCK_INITIALIZER; +rw_spinlock gWaitObjectListenerLock = B_RW_SPINLOCK_INITIALIZER; WaitObjectListener::~WaitObjectListener()