mirror of https://github.com/deavmi/eventy.git
Compare commits
3 Commits
6cfaa9824e
...
e75e3f732d
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | e75e3f732d | |
Tristan B. Velloza Kildaire | 4fed9fc780 | |
Tristan B. Velloza Kildaire | 5bbb6d804a |
|
@ -24,7 +24,9 @@ public struct EngineSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Hold off mode
|
||||||
|
*
|
||||||
|
* Method to use for "sleeping" the event loop
|
||||||
*/
|
*/
|
||||||
public enum HoldOffMode
|
public enum HoldOffMode
|
||||||
{
|
{
|
||||||
|
|
|
@ -165,6 +165,7 @@ public final class Engine : Thread
|
||||||
this(EngineSettings settings)
|
this(EngineSettings settings)
|
||||||
{
|
{
|
||||||
super(&run);
|
super(&run);
|
||||||
|
|
||||||
queueLock = new Mutex();
|
queueLock = new Mutex();
|
||||||
handlerLock = new Mutex();
|
handlerLock = new Mutex();
|
||||||
threadStoreLock = new Mutex();
|
threadStoreLock = new Mutex();
|
||||||
|
@ -321,15 +322,17 @@ public final class Engine : Thread
|
||||||
running = false;
|
running = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispatch(Signal[] set, Event e)
|
* Creates a new thread per signal and dispatches the event to them
|
||||||
*
|
*
|
||||||
* Creates a new thread per signal and dispatches the event to them
|
* Params:
|
||||||
*
|
* signalSet = The signal handlers to use for dispatching
|
||||||
* TODO: Add ability to dispatch on this thread
|
* e = the Event to be dispatched to each handler
|
||||||
*/
|
*/
|
||||||
private void dispatch(Signal[] signalSet, Event e)
|
private void dispatch(Signal[] signalSet, Event e)
|
||||||
{
|
{
|
||||||
|
/* TODO: Add ability to dispatch on this thread */
|
||||||
|
|
||||||
foreach (Signal signal; signalSet)
|
foreach (Signal signal; signalSet)
|
||||||
{
|
{
|
||||||
/* Create a new Thread */
|
/* Create a new Thread */
|
||||||
|
@ -358,15 +361,20 @@ public final class Engine : Thread
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store the thread
|
* Adds a thread to the thread store
|
||||||
*
|
*
|
||||||
* TODO: This can only be implemented if we use
|
* Params:
|
||||||
* wrapper threads that exit, and we can signal
|
* t = the thread to add
|
||||||
* removal from thread store then
|
*/
|
||||||
*/
|
|
||||||
private void storeThread(DispatchWrapper t)
|
private void storeThread(DispatchWrapper t)
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* TODO: This can only be implemented if we use
|
||||||
|
* wrapper threads that exit, and we can signal
|
||||||
|
* removal from thread store then
|
||||||
|
*/
|
||||||
|
|
||||||
/* Lock the thread store from editing */
|
/* Lock the thread store from editing */
|
||||||
threadStoreLock.lock();
|
threadStoreLock.lock();
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,5 @@ public import eventy.event;
|
||||||
public import eventy.exceptions;
|
public import eventy.exceptions;
|
||||||
public import eventy.engine;
|
public import eventy.engine;
|
||||||
public import eventy.queues;
|
public import eventy.queues;
|
||||||
public import eventy.signal;
|
public import eventy.signal;
|
||||||
|
public import eventy.config;
|
Loading…
Reference in New Issue