From: jzhou Date: Thu, 3 May 2012 17:18:22 +0000 (+0000) Subject: Fix the thread safe problem X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e68d517ba21db2b8396953c8b9d31caeb70a8e1f;p=IRC.git Fix the thread safe problem --- diff --git a/Robust/src/ClassLibrary/MGC/gnu/ReentrantLock.java b/Robust/src/ClassLibrary/MGC/gnu/ReentrantLock.java index a6abc7b4..6415fc91 100644 --- a/Robust/src/ClassLibrary/MGC/gnu/ReentrantLock.java +++ b/Robust/src/ClassLibrary/MGC/gnu/ReentrantLock.java @@ -319,7 +319,7 @@ public class ReentrantLock implements /*Lock, java.io.*/Serializable { * * @throws InterruptedException if the current thread is interrupted */ - public void lockInterruptibly() throws InterruptedException { + public synchronized void lockInterruptibly() throws InterruptedException { Thread callingThread = Thread.currentThread(); while(isLocked && lockedBy != callingThread){ wait();