From d7e9392e255f938ea409c481adafa03257b2b811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 19 Mar 2006 22:34:05 +0000 Subject: [PATCH] forgot I made this change... added locking to the lookup of a cursor git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16842 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/CursorManager.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/servers/app/CursorManager.cpp b/src/servers/app/CursorManager.cpp index 609cb0f17f..e42f3cb3c7 100644 --- a/src/servers/app/CursorManager.cpp +++ b/src/servers/app/CursorManager.cpp @@ -418,11 +418,16 @@ CursorManager::SetDefaults() ServerCursor * CursorManager::FindCursor(int32 token) { - ServerCursor* cursor; - if (fTokenSpace.GetToken(token, kCursorToken, (void**)&cursor) == B_OK) - return cursor; + if (!Lock()) + return NULL; - return NULL; + ServerCursor* cursor; + if (fTokenSpace.GetToken(token, kCursorToken, (void**)&cursor) != B_OK) + cursor = NULL; + + Unlock(); + + return cursor; } @@ -435,6 +440,7 @@ CursorManager::_FindCursor(team_id clientTeam, const uint8* cursorData) if (cursor->OwningTeam() == clientTeam && cursor->CursorData() && memcmp(cursor->CursorData(), cursorData, 68) == 0) { +//printf("found already existing cursor\n"); return cursor; } }