comparison dwtx/core/internal/jobs/Deadlock.d @ 167:862b05e0334a

Add a wrapper for Thread
author Frank Benoit <benoit@tionex.de>
date Tue, 09 Sep 2008 15:59:16 +0200
parents 9d0585bcb7aa
children
comparison
equal deleted inserted replaced
163:e5dd0081ccba 167:862b05e0334a
10 * Port to the D programming language: 10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de> 11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 12 *******************************************************************************/
13 module dwtx.core.internal.jobs.Deadlock; 13 module dwtx.core.internal.jobs.Deadlock;
14 14
15 import tango.core.Thread; 15 import dwtx.dwtxhelper.JThread;
16 16
17 import dwt.dwthelper.utils; 17 import dwt.dwthelper.utils;
18 18
19 import dwtx.core.runtime.jobs.ISchedulingRule; 19 import dwtx.core.runtime.jobs.ISchedulingRule;
20 20
24 * as well as the thread that was chosen to be suspended and an array of locks 24 * as well as the thread that was chosen to be suspended and an array of locks
25 * held by that thread that are going to be suspended to resolve the deadlock. 25 * held by that thread that are going to be suspended to resolve the deadlock.
26 */ 26 */
27 class Deadlock { 27 class Deadlock {
28 //all the threads which are involved in the deadlock 28 //all the threads which are involved in the deadlock
29 private Thread[] threads; 29 private JThread[] threads;
30 //the thread whose locks will be suspended to resolve deadlock 30 //the thread whose locks will be suspended to resolve deadlock
31 private Thread candidate; 31 private JThread candidate;
32 //the locks that will be suspended 32 //the locks that will be suspended
33 private ISchedulingRule[] locks; 33 private ISchedulingRule[] locks;
34 34
35 public this(Thread[] threads, ISchedulingRule[] locks, Thread candidate) { 35 public this(JThread[] threads, ISchedulingRule[] locks, JThread candidate) {
36 this.threads = threads; 36 this.threads = threads;
37 this.locks = locks; 37 this.locks = locks;
38 this.candidate = candidate; 38 this.candidate = candidate;
39 } 39 }
40 40
41 public ISchedulingRule[] getLocks() { 41 public ISchedulingRule[] getLocks() {
42 return locks; 42 return locks;
43 } 43 }
44 44
45 public Thread getCandidate() { 45 public JThread getCandidate() {
46 return candidate; 46 return candidate;
47 } 47 }
48 48
49 public Thread[] getThreads() { 49 public JThread[] getThreads() {
50 return threads; 50 return threads;
51 } 51 }
52 } 52 }