Fix the thread safe problem
[IRC.git] / Robust / src / ClassLibrary / MGC / gnu / ReentrantLock.java
index a6abc7b46d83f1eedcc6e514c38940d941bd5775..6415fc9145a39c150723dc7939be3ad842cf4fec 100644 (file)
@@ -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();