WorkerThread Class Reference

Thread which processes WorkItems in it's WorkItemQueue. More...

#include <thread.h>

Inherits Thread.

Collaboration diagram for WorkerThread:
Collaboration graph
[legend]

Public Member Functions

void DoWork (WorkItem *item, int priority=0, bool toBeDeleted=true)
 Adds a new WorkItem to the queue.
void * Entry ()
 Overrides wxThread::Entry, thread entry point.
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

Private Member Functions

void CleanupWorkItem (WorkItem *item)

Private Attributes

WorkItemQueue m_workItems

Detailed Description

Thread which processes WorkItems in it's WorkItemQueue.

Definition at line 121 of file thread.h.


Member Function Documentation

void WorkerThread::CleanupWorkItem ( WorkItem item  )  [private]

Definition at line 210 of file thread.cpp.

void WorkerThread::DoWork ( WorkItem item,
int  priority = 0,
bool  toBeDeleted = true 
)

Adds a new WorkItem to the queue.

Definition at line 167 of file thread.cpp.

void * WorkerThread::Entry (  ) 

Overrides wxThread::Entry, thread entry point.

Definition at line 176 of file thread.cpp.

wxThreadError Thread::Run (  )  [inherited]

Definition at line 100 of file thread.cpp.

bool Thread::Sleep ( int  milliseconds  )  [inherited]

returns false when woken up

Definition at line 85 of file thread.cpp.

bool Thread::TestDestroy (  )  [inherited]

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 (  )  [inherited]

overrides wxThread::Wait . Wakes up from sleep if sleeping, to prevent delay.

Definition at line 94 of file thread.cpp.

void Thread::WakeUp (  )  [inherited]

call this from outside thread to wake up Sleep - ing thread

Definition at line 90 of file thread.cpp.


Field Documentation

bool Thread::m_must_exit [protected, inherited]

workaround for old wxWidgets bug

Definition at line 60 of file thread.h.

wxSemaphore Thread::m_thread_sleep_semaphore [protected, inherited]

Definition at line 58 of file thread.h.

Definition at line 132 of file thread.h.


The documentation for this class was generated from the following files:

Generated on Thu Dec 29 00:11:50 2011 for SpringLobby by doxygen 1.6.3