mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
de5a07ee71
git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@138 ea6a568a-9f4f-0410-981a-c910a81bb256
40 lines
884 B
Plaintext
40 lines
884 B
Plaintext
/*
|
|
NOTE: This file is not used - it is here just for reference. The
|
|
real module is defined internally in io.d.
|
|
*/
|
|
|
|
singleton thread;
|
|
|
|
// Used to kill or pause our own or other threads.
|
|
idle kill();
|
|
idle pause();
|
|
|
|
// Get status information about a thread
|
|
native bool isScheduled();
|
|
native bool isPaused();
|
|
native bool isIdle();
|
|
native bool isDead();
|
|
bool isAlive() { return !isDead(); }
|
|
|
|
// Create a new (paused) thread for a given function
|
|
native thread create(function() f);
|
|
|
|
// Schedule a (paused) thread to run the next frame
|
|
native restart();
|
|
|
|
// Call a (paused) thread directly - returns when the thread exits or
|
|
// calls an idle function.
|
|
idle call();
|
|
|
|
// Wait for a thread to finish. Will not return until the thread is
|
|
// dead.
|
|
idle wait();
|
|
|
|
// Start a function as a thread in the background
|
|
thread start(function() f)
|
|
{
|
|
var t = create(f);
|
|
t.restart();
|
|
return t;
|
|
}
|