EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.simulation.abstractsimengine.processes]

COVERAGE SUMMARY FOR SOURCE FILE [SimProcessThreadingStrategy.java]

nameclass, %method, %block, %line, %
SimProcessThreadingStrategy.java0%   (0/1)0%   (0/5)0%   (0/49)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SimProcessThreadingStrategy0%   (0/1)0%   (0/5)0%   (0/49)0%   (0/16)
SimProcessThreadingStrategy (): void 0%   (0/1)0%   (0/18)0%   (0/4)
finishProcess (): void 0%   (0/1)0%   (0/4)0%   (0/2)
resumeProcess (): void 0%   (0/1)0%   (0/7)0%   (0/3)
startProcess (Runnable): void 0%   (0/1)0%   (0/13)0%   (0/4)
suspendProcess (): void 0%   (0/1)0%   (0/7)0%   (0/3)

1package de.uka.ipd.sdq.simulation.abstractsimengine.processes;
2 
3import java.util.concurrent.Semaphore;
4 
5public class SimProcessThreadingStrategy implements ISimProcessStrategy {
6 
7        private Thread myThread = null;
8        private Semaphore waitingSemaphore = new Semaphore(0);
9        private Semaphore waitingForSuspendSemaphore = new Semaphore(0);
10 
11        public void startProcess(Runnable myRunnable) {
12                this.myThread = new Thread(myRunnable);
13                this.myThread.start();
14                waitingForSuspendSemaphore.acquireUninterruptibly();
15        }
16 
17        public void resumeProcess() {
18                waitingSemaphore.release();
19                waitingForSuspendSemaphore.acquireUninterruptibly();
20        }
21 
22        public void finishProcess() {
23                // This process is done and will not suspend any more...
24                // Hence, release its wait for suspend semaphore held by the main control thread.
25                this.waitingForSuspendSemaphore.release();
26        }
27 
28        public void suspendProcess() {
29                waitingForSuspendSemaphore.release();
30                waitingSemaphore.acquireUninterruptibly();
31        }
32 
33}

[all classes][de.uka.ipd.sdq.simulation.abstractsimengine.processes]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov