joinable thread, with overridden Sleep and Wait methods. More...
#include <thread.h>
Inherited by HttpDownloaderThread< ParentClass >, HttpDownloaderThread< UpdaterClass >, PingThread, TorrentMaintenanceThread, and WorkerThread.
Public Member Functions | |
| Thread () | |
| ~Thread () | |
| destructor Waits for thread to complete | |
| ExitCode | Wait () |
| overrides wxThread::Wait . Wakes up from sleep if sleeping, to prevent delay. | |
| bool | Sleep (int milliseconds) |
| returns false when woken up | |
| void | WakeUp () |
| call this from outside thread to wake up Sleep - ing thread | |
| bool | TestDestroy () |
| overrides wxThread::TestDestroy , which can fail on Wait | |
| wxThreadError | Run () |
Protected Attributes | |
| wxSemaphore | m_thread_sleep_semaphore |
| bool | m_must_exit |
| workaround for old wxWidgets bug | |
joinable thread, with overridden Sleep and Wait methods.
Sleep wakes up when you call Wait()
Definition at line 41 of file thread.h.
| Thread::Thread | ( | ) |
Definition at line 70 of file thread.cpp.
| Thread::~Thread | ( | ) |
destructor Waits for thread to complete
TODO this causes a segfault on exit for me (koshi) sometimes http://docs.wxwidgets.org/stable/wx_wxthread.html#wxthreadwait says to only call wxThread::Wait from another thread context.
Definition at line 81 of file thread.cpp.
| wxThreadError Thread::Run | ( | ) |
Definition at line 100 of file thread.cpp.
| bool Thread::Sleep | ( | int | milliseconds | ) |
returns false when woken up
Definition at line 85 of file thread.cpp.
| bool Thread::TestDestroy | ( | ) |
overrides wxThread::TestDestroy , which can fail on Wait
Reimplemented in HttpDownloaderThread< ParentClass >, TorrentMaintenanceThread, and HttpDownloaderThread< UpdaterClass >.
Definition at line 105 of file thread.cpp.
| Thread::ExitCode Thread::Wait | ( | ) |
overrides wxThread::Wait . Wakes up from sleep if sleeping, to prevent delay.
Definition at line 94 of file thread.cpp.
| void Thread::WakeUp | ( | ) |
call this from outside thread to wake up Sleep - ing thread
Definition at line 90 of file thread.cpp.
bool Thread::m_must_exit [protected] |
wxSemaphore Thread::m_thread_sleep_semaphore [protected] |
1.6.3