Changeset 3:e4ca2e057cec in xplcommon for src/xplcommon/posix/Thread.h
- Timestamp:
- 12/27/12 13:01:22 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/xplcommon/posix/Thread.h
r1 r3 28 28 // either expressed or implied, of the FreeBSD Project. 29 29 30 #ifndef XPLCOMMON_POSIXTHREAD_H 31 #define XPLCOMMON_POSIXTHREAD_H 32 //------------------------------------------------------------------------------ 33 34 #include "config.h" 35 36 #ifdef HAVE_PTHREAD_H 37 30 #ifndef XPLCOMMON_POSIX_THREAD_H 31 #define XPLCOMMON_POSIX_THREAD_H 38 32 //------------------------------------------------------------------------------ 39 33 … … 42 36 //------------------------------------------------------------------------------ 43 37 44 namespace xplcommon { 38 namespace xplcommon { namespace posix { 45 39 46 40 //------------------------------------------------------------------------------ … … 49 43 * A pthreads-based thread implementation. 50 44 */ 51 class POSIXThread45 class Thread 52 46 { 53 47 private: … … 66 60 * Virtual destructor. 67 61 */ 68 virtual ~ POSIXThread();62 virtual ~Thread(); 69 63 70 64 /** … … 87 81 88 82 //------------------------------------------------------------------------------ 89 90 /// Common type for OS-independent code91 typedef POSIXThread Thread;92 93 //------------------------------------------------------------------------------94 83 // Inline definitions 95 84 //------------------------------------------------------------------------------ 96 85 97 inline POSIXThread::~POSIXThread()86 inline Thread::~Thread() 98 87 { 99 88 } … … 101 90 //------------------------------------------------------------------------------ 102 91 103 inline bool POSIXThread::start()92 inline bool Thread::start() 104 93 { 105 94 return pthread_create(&thread, 0, &threadFn, this)>=0; … … 108 97 //------------------------------------------------------------------------------ 109 98 110 inline void POSIXThread::join()99 inline void Thread::join() 111 100 { 112 101 pthread_join(thread, 0); … … 115 104 //------------------------------------------------------------------------------ 116 105 117 } /* namespace xplcommon */106 } /* namespace xplcommon::posix */ } /* namespace xplcommon */ 118 107 119 108 //------------------------------------------------------------------------------ 120 #endif // HAVE_PTHREAD_H 121 122 #endif // XPLCOMMON_POSIXTHREAD_H 109 #endif // XPLCOMMON_POSIX_THREAD_H 123 110 124 111 // Local Variables:
Note:
See TracChangeset
for help on using the changeset viewer.