Class ThreadContext

class ThreadContext

ThreadContext class.

Public Functions

ThreadContext()

Default constructor.

~ThreadContext()

Destructor.

void lock()

Obtain the mutual exclusion lock.

void unlock()

Release the mutual exclusion lock.

void wait()

Wait for a condition.

void signal()

Signal a condition to a single waiting thread.

void broadcast()

Signal a condition to all waiting threads.

class Lock

Locks the mutex on construction and unlocks on deletion.

This class implements the “resource acquisition is initialization” paradigm (see http://www.research.att.com/~bs/glossary.html) of exception safe mutex locking and unlocking.

Public Functions

inline Lock(ThreadContext *t)

The constructor obtains the mutual exclusion lock …

inline ~Lock()

And the destructor releases it.