public class ThreadedCounter extends BaseThread
Modifier and Type | Field and Description |
---|---|
Integer |
counter
A thread-safe counter
|
paused, terminated
Constructor and Description |
---|
ThreadedCounter() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Clean up the counter residue
|
void |
init(KnowledgeBase knowledge)
Initialize the counter variable
|
static void |
main(java.lang.String... args) |
void |
run()
Executes the main thread logic.
|
getName
public Integer counter
public void init(KnowledgeBase knowledge)
init
in class BaseThread
knowledge
- context for querying/modifying current program statepublic void run()
run
in class BaseThread
public void cleanup()
cleanup
in class BaseThread
public static void main(java.lang.String... args) throws java.lang.InterruptedException, java.lang.Exception
java.lang.InterruptedException
java.lang.Exception