Gecode::Support::Thread Class Reference
[Simple thread and synchronization support]
Simple threads.
More...
#include <thread.hh>
Public Member Functions | |
| Thread (Runnable *r) | |
| Construct a new thread and run r. | |
| ~Thread (void) | |
| Destroy thread handle (does not terminate thread). | |
Static Public Member Functions | |
| 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). | |
Detailed Description
Simple threads.Threads are assumed to properly terminate, the destructor will only release the handle to a thread but will not terminate it. The thread ceases when the call to run terminates, then the runnable object passed will also be deleted.
Requires
#include <gecode/support/thread.hh>
Definition at line 99 of file thread.hh.
Constructor & Destructor Documentation
| Gecode::Support::Thread::Thread | ( | Runnable * | r | ) |
Construct a new thread and run r.
After r terminates, r is deleted. After that, the thread terminates.
Definition at line 53 of file pthreads.cpp.
| Gecode::Support::Thread::~Thread | ( | void | ) | [inline] |
Member Function Documentation
| void Gecode::Support::Thread::sleep | ( | unsigned int | ms | ) | [inline, static] |
| unsigned int Gecode::Support::Thread::npu | ( | void | ) | [inline, static] |
Return number of processing units (1 if information not available).
Definition at line 60 of file pthreads.hpp.
The documentation for this class was generated from the following files:
- gecode/support/thread.hh (Revision: 9138)
- gecode/support/thread/pthreads.cpp (Revision: 9163)
- gecode/support/thread/pthreads.hpp (Revision: 9163)
