From d5314ec095b26892b07dc9aa51a3d8db9eee6213 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Sun, 24 Jul 2011 10:50:33 +0000 Subject: [PATCH] * It helps a lot to find thread problems when the multi locker assert macros actually doing something useful. Took me forever to finally realise that and to find a threading bug. * Remove a superfluously assert which sends the app server into the debugger. More fixes following. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42472 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/MultiLocker.h | 7 ++++--- src/servers/app/Workspace.cpp | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/servers/app/MultiLocker.h b/src/servers/app/MultiLocker.h index 30446e57a2..318aea9012 100644 --- a/src/servers/app/MultiLocker.h +++ b/src/servers/app/MultiLocker.h @@ -25,13 +25,14 @@ #define MULTI_LOCKER_TIMING 0 #if DEBUG +# include # define MULTI_LOCKER_DEBUG DEBUG #endif #if MULTI_LOCKER_DEBUG -# define ASSERT_MULTI_LOCKED(x) ((x).IsWriteLocked() || (x).IsReadLocked()) -# define ASSERT_MULTI_READ_LOCKED(x) ((x).IsReadLocked()) -# define ASSERT_MULTI_WRITE_LOCKED(x) ((x).IsWriteLocked()) +# define ASSERT_MULTI_LOCKED(x) assert((x).IsWriteLocked() || (x).IsReadLocked()) +# define ASSERT_MULTI_READ_LOCKED(x) assert((x).IsReadLocked()) +# define ASSERT_MULTI_WRITE_LOCKED(x) assert((x).IsWriteLocked()) #else # define MULTI_LOCKER_DEBUG 0 # define ASSERT_MULTI_LOCKED(x) ; diff --git a/src/servers/app/Workspace.cpp b/src/servers/app/Workspace.cpp index 617ecba1e1..887ee6cfb4 100644 --- a/src/servers/app/Workspace.cpp +++ b/src/servers/app/Workspace.cpp @@ -82,7 +82,6 @@ Workspace::Workspace(Desktop& desktop, int32 index) fDesktop(desktop), fCurrentWorkspace(index == desktop.CurrentWorkspace()) { - ASSERT_MULTI_LOCKED(desktop.WindowLocker()); RewindWindows(); }