From 0081ad43b959de6d3384a2149b76744ca00f705d Mon Sep 17 00:00:00 2001 From: wcrisman Date: Fri, 11 Jul 2014 17:13:25 -0700 Subject: [PATCH] Fixed bugs introduced into Monitor when adding debug info and simplifying. --- Common/src/com/common/thread/Monitor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/src/com/common/thread/Monitor.java b/Common/src/com/common/thread/Monitor.java index 1b852cc..67ed8b5 100644 --- a/Common/src/com/common/thread/Monitor.java +++ b/Common/src/com/common/thread/Monitor.java @@ -276,8 +276,8 @@ public static void unlock(Monitor monitor) { //Reduce the lock count and clear the lock if zero.// if(--threadData.lockCount == 0) { synchronized(monitor.lock) { - monitor.lockingThreadData = null; monitor.lock.notify(); + monitor.lockingThreadData = null; threadData.currentLock = null; threadData.lockCount = 0; threadData.stack = null; @@ -313,12 +313,12 @@ private static void suspend(ThreadData threadData) { if(threadData.currentLock != null) { //Allow another thread to lock the previously held monitor.// synchronized(threadData.currentLock.lock) { + System.out.println("MONITOR: Suspended lock: " + Integer.toHexString(threadData.currentLock.lock.hashCode())); + threadData.currentLock.lock.notify(); threadData.currentLock.lockingThreadData = null; threadData.lockCount = 0; threadData.currentLock = null; threadData.stack = null; - threadData.currentLock.lock.notify(); - System.out.println("MONITOR: Suspended lock: " + Integer.toHexString(threadData.currentLock.lock.hashCode())); }//synchronized// }//if// }//if//