From 3e40d97a9a7a60e746b3703d2c7d3f4884159a52 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 15 Sep 2015 06:36:35 +0200 Subject: Bug 1213: Use InterruptSource.Thread --- src/junit/com/jogamp/common/util/TestRunnableTask01.java | 4 ++-- .../com/jogamp/common/util/locks/TestRecursiveLock01.java | 7 ++++--- .../common/util/locks/TestRecursiveThreadGroupLock01.java | 11 ++++++----- .../jogamp/common/util/locks/TestSingletonServerSocket00.java | 3 ++- 4 files changed, 14 insertions(+), 11 deletions(-) (limited to 'src/junit/com/jogamp/common/util') diff --git a/src/junit/com/jogamp/common/util/TestRunnableTask01.java b/src/junit/com/jogamp/common/util/TestRunnableTask01.java index 76c2d2a..6fd8f19 100644 --- a/src/junit/com/jogamp/common/util/TestRunnableTask01.java +++ b/src/junit/com/jogamp/common/util/TestRunnableTask01.java @@ -60,7 +60,7 @@ public class TestRunnableTask01 extends SingletonJunitCase { System.err.println("BB.0: "+syncObject); synchronized (syncObject) { System.err.println("BB.1: "+syncObject); - new Thread(clientAction, Thread.currentThread().getName()+"-clientAction").start(); + new InterruptSource.Thread(null, clientAction, Thread.currentThread().getName()+"-clientAction").start(); try { System.err.println("BB.2"); syncObject.wait(); @@ -88,7 +88,7 @@ public class TestRunnableTask01 extends SingletonJunitCase { System.err.println("BB.0: "+rTask.getSyncObject()); synchronized (rTask.getSyncObject()) { System.err.println("BB.1: "+rTask.getSyncObject()); - new Thread(rTask, Thread.currentThread().getName()+"-clientAction").start(); + new InterruptSource.Thread(null, rTask, Thread.currentThread().getName()+"-clientAction").start(); try { System.err.println("BB.2"); rTask.getSyncObject().wait(); diff --git a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java index 4508f94..7455618 100644 --- a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java +++ b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java @@ -38,6 +38,7 @@ import org.junit.Assert; import org.junit.Test; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.InterruptSource; import com.jogamp.junit.util.SingletonJunitCase; import org.junit.FixMethodOrder; @@ -170,7 +171,7 @@ public class TestRecursiveLock01 extends SingletonJunitCase { public final void action2Deferred(final int l, final YieldMode yieldMode) { final Action2 action2 = new Action2(l, yieldMode); - new Thread(action2, Thread.currentThread().getName()+"-deferred").start(); + new InterruptSource.Thread(null, action2, Thread.currentThread().getName()+"-deferred").start(); } public final void lock() { @@ -296,14 +297,14 @@ public class TestRecursiveLock01 extends SingletonJunitCase { final long t0 = System.currentTimeMillis(); final LockedObject lo = new LockedObject(implType, fair); final LockedObjectRunner[] runners = new LockedObjectRunner[threadNum]; - final Thread[] threads = new Thread[threadNum]; + final InterruptSource.Thread[] threads = new InterruptSource.Thread[threadNum]; int i; for(i=0; i