Added rudimentary shutdown() method

This commit is contained in:
Tristan B. Velloza Kildaire 2022-04-07 10:11:59 +02:00
parent ea1e317431
commit 692660772a
1 changed files with 15 additions and 1 deletions

View File

@ -95,6 +95,8 @@ public final class Engine : Thread
private Duration sleepTime;
private bool running;
this()
{
super(&run);
@ -144,7 +146,9 @@ public final class Engine : Thread
*/
public void run()
{
while(true)
running = true;
while(running)
{
/* TODO: Implement me */
@ -198,6 +202,16 @@ public final class Engine : Thread
}
}
/**
* Stops the event engine
*
* TODO: Examine edge cases where this might not work
*/
public void shutdown()
{
running = false;
}
/**
* Dispatch(Signal[] set, Event e)
*