Gecode::Support::Thread Class Reference
[Simple thread and synchronization support]
Simple threads. More...
#include <thread.hpp>
Classes | |
class | Run |
A real thread. More... | |
Static Public Member Functions | |
static Mutex * | m (void) |
Mutex for synchronization. | |
static void | run (Runnable *r) |
Construct a new thread and run r. | |
static void | sleep (unsigned int ms) |
Put current thread to sleep for ms milliseconds. | |
static unsigned int | npu (void) |
Return number of processing units (1 if information not available). | |
Static Public Attributes | |
static Run * | idle = NULL |
Idle runners. |
Detailed Description
Simple threads.
Threads cannot be created, only runnable objects can be submitted for execution by a thread. Threads are pooled to avoid creation/destruction of threads as much as possible.
Definition at line 288 of file thread.hpp.
Member Function Documentation
Mutex * Gecode::Support::Thread::m | ( | void | ) | [static] |
Mutex for synchronization.
Definition at line 46 of file thread.cpp.
void Gecode::Support::Thread::run | ( | Runnable * | r | ) | [inline, static] |
Construct a new thread and run r.
After r terminates, r is deleted. After that, the thread terminates.
If the operating system does not support any threads, throws an exception of type Support::OperatingSystemError.
Definition at line 120 of file thread.hpp.
void Gecode::Support::Thread::sleep | ( | unsigned int | ms | ) | [inline, static] |
unsigned int Gecode::Support::Thread::npu | ( | void | ) | [inline, static] |
Member Data Documentation
Thread::Run * Gecode::Support::Thread::idle = NULL [static] |
Idle runners.
Definition at line 315 of file thread.hpp.
The documentation for this class was generated from the following files:
- gecode/support/thread.hpp (Revision: 14967)
- gecode/support/thread/none.hpp (Revision: 12399)
- gecode/support/thread/pthreads.hpp (Revision: 14653)
- gecode/support/thread/thread.cpp (Revision: 14967)
- gecode/support/thread/thread.hpp (Revision: 14762)
- gecode/support/thread/windows.hpp (Revision: 14653)