Use Java-provided mechanism for sanity checking.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1926 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-11-07 22:42:51 +00:00
parent 628b82294a
commit d50852ebb1
@@ -1,8 +1,9 @@
// //
// $Id: RegionManager.java,v 1.8 2002/11/07 21:45:20 mdb Exp $ // $Id: RegionManager.java,v 1.9 2002/11/07 22:42:51 mdb Exp $
package com.threerings.media; package com.threerings.media;
import java.awt.EventQueue;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
@@ -47,13 +48,9 @@ public class RegionManager
*/ */
public void addDirtyRegion (Rectangle rect) public void addDirtyRegion (Rectangle rect)
{ {
// make sure we're on what we believe to be the AWT thread // make sure we're on an AWT thread
Thread current = Thread.currentThread(); if (!EventQueue.isDispatchThread()) {
if (_awtThread == null) { Log.warning("Oi! Region dirtied on non-AWT thread " +
// grab the first thread we see and call it the AWT
_awtThread = current;
} else if (_awtThread != current) {
Log.warning("Oi! Region dirtied from non-AWT thread " +
"[rect=" + rect + "]."); "[rect=" + rect + "].");
Thread.dumpStack(); Thread.dumpStack();
} }
@@ -136,7 +133,4 @@ public class RegionManager
/** A list of dirty rectangles. */ /** A list of dirty rectangles. */
protected ArrayList _dirty = new ArrayList(); protected ArrayList _dirty = new ArrayList();
/** Used for debugging thread sketchiness. */
protected Thread _awtThread;
} }