Lock WindowForClientLooperPort method and add comment that the window lock has to be held if accessing the a WindowList.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38215 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler
2010-08-17 22:56:19 +00:00
parent 94892dc091
commit 26d8064ea8
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -2487,6 +2487,8 @@ Desktop::AllWindows()
Window* Window*
Desktop::WindowForClientLooperPort(port_id port) Desktop::WindowForClientLooperPort(port_id port)
{ {
AutoReadLocker locker(fWindowLock);
for (Window* window = fAllWindows.FirstWindow(); window != NULL; for (Window* window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) { window = window->NextWindow(kAllWindowList)) {
if (window->ServerWindow()->ClientLooperPort() == port) if (window->ServerWindow()->ClientLooperPort() == port)
+1
View File
@@ -257,6 +257,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!
WindowList& CurrentWindows(); WindowList& CurrentWindows();
WindowList& AllWindows(); WindowList& AllWindows();