Added TODO comments about some race conditions in the code because of unlocking

the desktop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17139 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-04-16 13:18:35 +00:00
parent b2536cb5d6
commit 6aa4743b51

View File

@ -607,6 +607,7 @@ fDesktop->LockSingleWindow();
WindowLayer *behindOf;
if ((behindOf = fDesktop->FindWindowLayerByClientToken(token, teamID)) != NULL) {
fDesktop->UnlockSingleWindow();
// TODO: there is a big race condition when we unlock here (window could be gone by now)!
fDesktop->SendWindowBehind(fWindowLayer, behindOf);
fDesktop->LockSingleWindow();
status = B_OK;
@ -673,6 +674,7 @@ fDesktop->LockSingleWindow();
status = B_BAD_VALUE;
} else {
fDesktop->UnlockSingleWindow();
// TODO: there is a big race condition when we unlock here (window could be gone by now)!
status = fDesktop->AddWindowToSubset(fWindowLayer, windowLayer)
? B_OK : B_NO_MEMORY;
fDesktop->LockSingleWindow();
@ -694,6 +696,7 @@ fDesktop->LockSingleWindow();
token, App()->ClientTeam());
if (windowLayer != NULL) {
fDesktop->UnlockSingleWindow();
// TODO: there is a big race condition when we unlock here (window could be gone by now)!
fDesktop->RemoveWindowFromSubset(fWindowLayer, windowLayer);
fDesktop->LockSingleWindow();
status = B_OK;