From 52ede95cd7b0ece647027cca23b38f274473fb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 18 Aug 2010 10:10:27 +0000 Subject: [PATCH] * Removed outdated USE_MULTI_LOCKER build option * Don't acquire the read-lock in WindowForClientLooperPort, since MultiLocker does not support nested read-locks. Use an assert instead, however the method does not appear to be used anywhere at the moment. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38224 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 6 ++---- src/servers/app/Desktop.h | 28 ++-------------------------- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index bcb1829254..dfd5de61d1 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -64,9 +64,6 @@ # define STRACE(a) ; #endif -#if !USE_MULTI_LOCKER -# define AutoWriteLocker BAutolock -#endif class KeyboardFilter : public EventFilter { public: @@ -84,6 +81,7 @@ class KeyboardFilter : public EventFilter { bigtime_t fTimestamp; }; + class MouseFilter : public EventFilter { public: MouseFilter(Desktop* desktop); @@ -2487,7 +2485,7 @@ Desktop::AllWindows() Window* Desktop::WindowForClientLooperPort(port_id port) { - AutoReadLocker locker(fWindowLock); + ASSERT(fWindowLock.IsReadLocked()); for (Window* window = fAllWindows.FirstWindow(); window != NULL; window = window->NextWindow(kAllWindowList)) { diff --git a/src/servers/app/Desktop.h b/src/servers/app/Desktop.h index fab5c6fc31..e6182b0f5f 100644 --- a/src/servers/app/Desktop.h +++ b/src/servers/app/Desktop.h @@ -27,6 +27,7 @@ #include "DesktopSettings.h" #include "EventDispatcher.h" #include "MessageLooper.h" +#include "MultiLocker.h" #include "Screen.h" #include "ScreenManager.h" #include "ServerCursor.h" @@ -36,15 +37,6 @@ #include "WorkspacePrivate.h" -#define USE_MULTI_LOCKER 1 - -#if USE_MULTI_LOCKER -# include "MultiLocker.h" -#else -# include -#endif - - class BMessage; class DrawingEngine; @@ -83,7 +75,6 @@ public: void KeyEvent(uint32 what, int32 key, int32 modifiers); // Locking -#if USE_MULTI_LOCKER bool LockSingleWindow() { return fWindowLock.ReadLock(); } void UnlockSingleWindow() @@ -95,17 +86,6 @@ public: { fWindowLock.WriteUnlock(); } const MultiLocker& WindowLocker() { return fWindowLock; } -#else // USE_MULTI_LOCKER - bool LockSingleWindow() - { return fWindowLock.Lock(); } - void UnlockSingleWindow() - { fWindowLock.Unlock(); } - - bool LockAllWindows() - { return fWindowLock.Lock(); } - void UnlockAllWindows() - { fWindowLock.Unlock(); } -#endif // USE_MULTI_LOCKER // Mouse and cursor methods @@ -257,7 +237,7 @@ public: void WriteWindowOrder(int32 workspace, BPrivate::LinkSender& sender); - //! The window lock has to be held when accessing a window list! + //! The window lock must be held when accessing a window list! WindowList& CurrentWindows(); WindowList& AllWindows(); @@ -351,11 +331,7 @@ private: CursorManager fCursorManager; -#if USE_MULTI_LOCKER MultiLocker fWindowLock; -#else - BLocker fWindowLock; -#endif BRegion fBackgroundRegion; BRegion fScreenRegion;