35 class ethread :
public virtual basis::root_object
72 bool start(
void *thread_data);
84 void cancel() { _stop_thread =
true; }
115 int sleep_time()
const {
return _sleep_time; }
119 void sleep_time(
int new_sleep) { _sleep_time = new_sleep; }
163 static void *periodic_thread_driver(
void *hidden_pointer);
164 static void *one_shot_thread_driver(
void *hidden_pointer);
Provides a platform-independent object for adding threads to a program.
int sleep_time() const
returns the current periodic thread interval.
bool start(void *thread_data)
causes the thread to start, if it has not already been started.
void cancel()
stops the thread but does not wait until it has terminated.
virtual void perform_activity(void *thread_data)=0
< invoked just after after start(), when the OS thread is created.
bool thread_started() const
returns true if the thread has been started.
DEFINE_CLASS_NAME("ethread")
void exempt_stop()
this special form of stop() does not wait for the thread to exit.
bool thread_finished() const
returns true if the thread has exited.
void stop()
tells the thread to shutdown and waits for the shutdown to occur.
ethread()
creates a single-shot thread object.
void reschedule(int delay=0)
causes a periodic thread to activate after "delay" milliseconds from now.
bool thread_active() const
returns true if the thread is currently performing its activity.
bool should_stop() const
reports whether the thread should stop right now.
Represents a point in time relative to the operating system startup time.