* 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
This commit is contained in:
@@ -64,9 +64,6 @@
|
|||||||
# define STRACE(a) ;
|
# define STRACE(a) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !USE_MULTI_LOCKER
|
|
||||||
# define AutoWriteLocker BAutolock
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class KeyboardFilter : public EventFilter {
|
class KeyboardFilter : public EventFilter {
|
||||||
public:
|
public:
|
||||||
@@ -84,6 +81,7 @@ class KeyboardFilter : public EventFilter {
|
|||||||
bigtime_t fTimestamp;
|
bigtime_t fTimestamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class MouseFilter : public EventFilter {
|
class MouseFilter : public EventFilter {
|
||||||
public:
|
public:
|
||||||
MouseFilter(Desktop* desktop);
|
MouseFilter(Desktop* desktop);
|
||||||
@@ -2487,7 +2485,7 @@ Desktop::AllWindows()
|
|||||||
Window*
|
Window*
|
||||||
Desktop::WindowForClientLooperPort(port_id port)
|
Desktop::WindowForClientLooperPort(port_id port)
|
||||||
{
|
{
|
||||||
AutoReadLocker locker(fWindowLock);
|
ASSERT(fWindowLock.IsReadLocked());
|
||||||
|
|
||||||
for (Window* window = fAllWindows.FirstWindow(); window != NULL;
|
for (Window* window = fAllWindows.FirstWindow(); window != NULL;
|
||||||
window = window->NextWindow(kAllWindowList)) {
|
window = window->NextWindow(kAllWindowList)) {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "DesktopSettings.h"
|
#include "DesktopSettings.h"
|
||||||
#include "EventDispatcher.h"
|
#include "EventDispatcher.h"
|
||||||
#include "MessageLooper.h"
|
#include "MessageLooper.h"
|
||||||
|
#include "MultiLocker.h"
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "ServerCursor.h"
|
#include "ServerCursor.h"
|
||||||
@@ -36,15 +37,6 @@
|
|||||||
#include "WorkspacePrivate.h"
|
#include "WorkspacePrivate.h"
|
||||||
|
|
||||||
|
|
||||||
#define USE_MULTI_LOCKER 1
|
|
||||||
|
|
||||||
#if USE_MULTI_LOCKER
|
|
||||||
# include "MultiLocker.h"
|
|
||||||
#else
|
|
||||||
# include <Locker.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
class BMessage;
|
class BMessage;
|
||||||
|
|
||||||
class DrawingEngine;
|
class DrawingEngine;
|
||||||
@@ -83,7 +75,6 @@ public:
|
|||||||
void KeyEvent(uint32 what, int32 key,
|
void KeyEvent(uint32 what, int32 key,
|
||||||
int32 modifiers);
|
int32 modifiers);
|
||||||
// Locking
|
// Locking
|
||||||
#if USE_MULTI_LOCKER
|
|
||||||
bool LockSingleWindow()
|
bool LockSingleWindow()
|
||||||
{ return fWindowLock.ReadLock(); }
|
{ return fWindowLock.ReadLock(); }
|
||||||
void UnlockSingleWindow()
|
void UnlockSingleWindow()
|
||||||
@@ -95,17 +86,6 @@ public:
|
|||||||
{ fWindowLock.WriteUnlock(); }
|
{ fWindowLock.WriteUnlock(); }
|
||||||
|
|
||||||
const MultiLocker& WindowLocker() { return fWindowLock; }
|
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
|
// Mouse and cursor methods
|
||||||
|
|
||||||
@@ -257,7 +237,7 @@ public:
|
|||||||
void WriteWindowOrder(int32 workspace,
|
void WriteWindowOrder(int32 workspace,
|
||||||
BPrivate::LinkSender& sender);
|
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& CurrentWindows();
|
||||||
WindowList& AllWindows();
|
WindowList& AllWindows();
|
||||||
|
|
||||||
@@ -351,11 +331,7 @@ private:
|
|||||||
|
|
||||||
CursorManager fCursorManager;
|
CursorManager fCursorManager;
|
||||||
|
|
||||||
#if USE_MULTI_LOCKER
|
|
||||||
MultiLocker fWindowLock;
|
MultiLocker fWindowLock;
|
||||||
#else
|
|
||||||
BLocker fWindowLock;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BRegion fBackgroundRegion;
|
BRegion fBackgroundRegion;
|
||||||
BRegion fScreenRegion;
|
BRegion fScreenRegion;
|
||||||
|
|||||||
Reference in New Issue
Block a user