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.
|
getNamepublic Integer counter
public void init(KnowledgeBase knowledge)
init in class BaseThreadknowledge - context for querying/modifying current program statepublic void run()
run in class BaseThreadpublic void cleanup()
cleanup in class BaseThreadpublic static void main(java.lang.String... args)
throws java.lang.InterruptedException,
java.lang.Exception
java.lang.InterruptedExceptionjava.lang.Exception