From b93d2480cc97e6d3c3ff2e69062e6cddc45dd1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 6 Jul 2005 04:52:58 +0000 Subject: [PATCH] Now drops into the debugger if the window/looper is still locked in task_looper(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13480 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/app/Looper.cpp | 43 ++++++++++++----------------------- src/kits/interface/Window.cpp | 3 +++ 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/kits/app/Looper.cpp b/src/kits/app/Looper.cpp index 9100006c1f..129eaeb743 100644 --- a/src/kits/app/Looper.cpp +++ b/src/kits/app/Looper.cpp @@ -1,29 +1,15 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2005, Haiku -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: Looper.cpp -// Author(s): Erik Jaesler (erik@cgsoftware.com) -// DarkWyrm (bpmagic@columbus.rr.com) -// Description: BLooper class spawns a thread that runs a message loop. -//------------------------------------------------------------------------------ +/* + * Copyright 2001-2005, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Erik Jaesler (erik@cgsoftware.com) + * DarkWyrm (bpmagic@columbus.rr.com) + * Ingo Weinhold, bonefish@@users.sf.net + * Axel Dörfler, axeld@pinc-software.de + */ + +/** BLooper class spawns a thread that runs a message loop. */ /** @note Although I'm implementing "by the book" for now, I would like to @@ -31,8 +17,6 @@ into their own class in the BPrivate namespace. Also considering adding the thread priority when archiving. - - */ // debugging @@ -1211,6 +1195,9 @@ BLooper::task_looper() // Unlock the looper Unlock(); + if (IsLocked()) + debugger("looper must not be locked!"); + // loop: As long as we are not terminating. while (!fTerminating) { diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 17364bfcf3..f62824317a 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -2140,6 +2140,9 @@ BWindow::task_looper() // Unlock the looper Unlock(); + if (IsLocked()) + debugger("window must not be locked!"); + // loop: As long as we are not terminating. while (!fTerminating) { // TODO: timeout determination algo