diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2008-08-06 20:56:19 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2008-08-06 20:56:19 +0000 |
| commit | 31b2f1436808fc07f636dc02416386e44b23071c (patch) | |
| tree | 2e15eae70757abc73ce1360787acf8293566ef0f /cpp/src/qpid/sys/Thread.h | |
| parent | 8451864c21e9424b880c61104108e8c76864b7cb (diff) | |
| download | qpid-python-31b2f1436808fc07f636dc02416386e44b23071c.tar.gz | |
Refactor Thread platform code so that the implementation is completely
decoupled from its interface
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@683402 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/Thread.h')
| -rw-r--r-- | cpp/src/qpid/sys/Thread.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/cpp/src/qpid/sys/Thread.h b/cpp/src/qpid/sys/Thread.h index fd9be5617e..3188e45341 100644 --- a/cpp/src/qpid/sys/Thread.h +++ b/cpp/src/qpid/sys/Thread.h @@ -21,11 +21,34 @@ * under the License. * */ +#include <boost/shared_ptr.hpp> -#ifdef USE_APR_PLATFORM -#include "apr/Thread.h" -#else -#include "posix/Thread.h" -#endif +namespace qpid { +namespace sys { +class Runnable; +class ThreadPrivate; + +class Thread +{ + boost::shared_ptr<ThreadPrivate> impl; + + public: + Thread(); + explicit Thread(qpid::sys::Runnable*); + explicit Thread(qpid::sys::Runnable&); + + void join(); + + unsigned long id(); + + static Thread current(); + + /** ID of current thread for logging. + * Workaround for broken Thread::current() in APR + */ + static unsigned long logId() { return current().id(); } +}; + +}} #endif /*!_sys_Thread_h*/ |
