Author: stippi Date: 2010-08-18 12:10:27 +0200 (Wed, 18 Aug 2010) New Revision: 38224 Changeset: http://dev.haiku-os.org/changeset/38224 Modified: haiku/trunk/src/servers/app/Desktop.cpp haiku/trunk/src/servers/app/Desktop.h Log: * 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. Modified: haiku/trunk/src/servers/app/Desktop.cpp =================================================================== --- haiku/trunk/src/servers/app/Desktop.cpp 2010-08-18 09:57:17 UTC (rev 38223) +++ haiku/trunk/src/servers/app/Desktop.cpp 2010-08-18 10:10:27 UTC (rev 38224) @@ -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 @@ bigtime_t fTimestamp; }; + class MouseFilter : public EventFilter { public: MouseFilter(Desktop* desktop); @@ -2487,7 +2485,7 @@ Window* Desktop::WindowForClientLooperPort(port_id port) { - AutoReadLocker locker(fWindowLock); + ASSERT(fWindowLock.IsReadLocked()); for (Window* window = fAllWindows.FirstWindow(); window != NULL; window = window->NextWindow(kAllWindowList)) { Modified: haiku/trunk/src/servers/app/Desktop.h =================================================================== --- haiku/trunk/src/servers/app/Desktop.h 2010-08-18 09:57:17 UTC (rev 38223) +++ haiku/trunk/src/servers/app/Desktop.h 2010-08-18 10:10:27 UTC (rev 38224) @@ -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 <Locker.h> -#endif - - class BMessage; class DrawingEngine; @@ -83,7 +75,6 @@ void KeyEvent(uint32 what, int32 key, int32 modifiers); // Locking -#if USE_MULTI_LOCKER bool LockSingleWindow() { return fWindowLock.ReadLock(); } void UnlockSingleWindow() @@ -95,18 +86,7 @@ { 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 void SetCursor(ServerCursor* cursor); @@ -257,7 +237,7 @@ 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 @@ CursorManager fCursorManager; -#if USE_MULTI_LOCKER MultiLocker fWindowLock; -#else - BLocker fWindowLock; -#endif BRegion fBackgroundRegion; BRegion fScreenRegion;