ParThread.java 2.35 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov Date: 22/10/2010 00:26:10
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)

//package org.jcsp.lang; DJ
package jcircus.classesdescompiladas;

import org.jcsp.lang.*;

// Referenced classes of package org.jcsp.lang:
// Barrier, Parallel, CSProcess

class ParThread extends Thread
{

public ParThread(CSProcess csprocess, Barrier barrier1)
{
running = true;
park = new Barrier(2);
setDaemon(true);
process = csprocess;
barrier = barrier1;
setName(csprocess.toString());
}

public void reset(CSProcess csprocess, Barrier barrier1)
{
process = csprocess;
barrier = barrier1;
setName(csprocess.toString());
}

public void terminate()
{
running = false;
park.sync();
}

public void release()
{
park.sync();
}

public void run()
{
try {
CSPParallel.addToAllParThreads(this);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
while(running)
{
try
{
process.run();
}
catch(Throwable throwable)
{
CSPParallel.uncaughtException("org.jcsp.lang.Parallel", throwable);
}
barrier.resign();
park.sync();
}
CSPParallel.removeFromAllParThreads(this);
//break MISSING_BLOCK_LABEL_75; //Sam's
Throwable throwable1 = /*Sam's ->*/ new Throwable ();
//throwable1; //DJ
CSPParallel.uncaughtException("org.jcsp.lang.Parallel", throwable1);
CSPParallel.removeFromAllParThreads(this);
//break MISSING_BLOCK_LABEL_75; //Sam's
Exception exception /*Sam's ->*/ = new Exception ();
//exception; //DJ
CSPParallel.removeFromAllParThreads(this);
try { //Sam's
throw exception;
} catch (Exception e) { //Sam's
// TODO Auto-generated catch block
e.printStackTrace();
}
}

private CSProcess process;
private Barrier barrier;
private boolean running;
private Barrier park;
}