More work on tangibleCharacter, especially thread synch stuff
This commit is contained in:
@@ -11,15 +11,13 @@
|
||||
// * You have a function to run in the background.
|
||||
// * It should start the instant a foreground thread says "NOW".
|
||||
// * It should be run exactly once for each "NOW".
|
||||
// * The foreground thread eventually waits for the background thread to finish.
|
||||
//
|
||||
// To use this class, construct an FTriggeredTask,
|
||||
// and provide a runnable object. The runnable
|
||||
// object's "Run" method will get executed in
|
||||
// each time you call 'Trigger' on the FTriggeredTask.
|
||||
//
|
||||
// The run method will never get called reentrantly,
|
||||
// even if you call 'Trigger' rapidly in succession.
|
||||
//
|
||||
///////////////////////////////////////////////
|
||||
|
||||
class FTriggeredTask : public FRunnable
|
||||
@@ -43,7 +41,12 @@ private:
|
||||
// once. But if ThreadStopRequested is true, it means we
|
||||
// want the thread to exit.
|
||||
//
|
||||
FEvent* ThreadEvent;
|
||||
FEvent* CallEvent;
|
||||
|
||||
// This event is used when the thread is done
|
||||
// with its work.
|
||||
//
|
||||
FEvent* ReturnEvent;
|
||||
|
||||
// The client whose task we're triggering.
|
||||
//
|
||||
@@ -91,12 +94,18 @@ public:
|
||||
// Trigger
|
||||
//
|
||||
// Run the client's 'RUN' method once, in the
|
||||
// background. Trigger is a no-op if the system
|
||||
// is shut down. If you trigger when the task
|
||||
// is already running, a trigger may get dropped.
|
||||
// background.
|
||||
//
|
||||
void Trigger();
|
||||
|
||||
// Wait
|
||||
//
|
||||
// Wait for the background task to finish its work.
|
||||
// If the background thread isn't running, then this
|
||||
// returns immediately.
|
||||
//
|
||||
void Wait();
|
||||
|
||||
// IsRunning
|
||||
//
|
||||
bool IsRunning();
|
||||
|
||||
Reference in New Issue
Block a user