Changeset 3:e4ca2e057cec in xplcommon for src/xplcommon/win32/Thread.h


Ignore:
Timestamp:
12/27/12 13:01:22 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Reorganized the code a bit

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/xplcommon/win32/Thread.h

    r1 r3  
    2828// either expressed or implied, of the FreeBSD Project.
    2929
    30 #ifndef XPLCOMMON_WIN32THREAD_H
    31 #define XPLCOMMON_WIN32THREAD_H
    32 //------------------------------------------------------------------------------
    33 
    34 #include "config.h"
    35 
    36 #ifdef HAVE_WINDOWS_H
     30#ifndef XPLCOMMON_WIN32_THREAD_H
     31#define XPLCOMMON_WIN32_THREAD_H
    3732//------------------------------------------------------------------------------
    3833
     
    4136//------------------------------------------------------------------------------
    4237
    43 namespace xplcommon {
     38namespace xplcommon { namespace win32 {
    4439
    4540//------------------------------------------------------------------------------
     
    4843 * A Win32 API thread implementation.
    4944 */
    50 class Win32Thread
     45class Thread
    5146{
    5247private:
     
    6560     * Virtual destructor.
    6661     */
    67     virtual ~Win32Thread();
     62    virtual ~Thread();
    6863
    6964    /**
     
    8681
    8782//------------------------------------------------------------------------------
    88 
    89 /// Common type for OS-independent code
    90 typedef Win32Thread Thread;
    91 
    92 //------------------------------------------------------------------------------
    9383// Inline definitions
    9484//------------------------------------------------------------------------------
    9585
    96 inline Win32Thread::~Win32Thread()
     86inline Thread::~Thread()
    9787{
    9888}
     
    10090//------------------------------------------------------------------------------
    10191
    102 inline bool Win32Thread::start()
     92inline bool Thread::start()
    10393{
    10494    handle = CreateThread(0, 0, &threadFn, this, 0, 0);
     
    10898//------------------------------------------------------------------------------
    10999
    110 inline void Win32Thread::join()
     100inline void Thread::join()
    111101{
    112102    WaitForSingleObject(handle, INFINITE);
     
    115105//------------------------------------------------------------------------------
    116106
    117 } /* namespace xplcommon */
     107} /* namespace xplcommon::win32 */ } /* namespace xplcommon */
    118108
    119109//------------------------------------------------------------------------------
    120 #endif // HAVE_PTHREAD_H
    121 
    122 #endif // XPLCOMMON_POSIXTHREAD_H
     110#endif // XPLCOMMON_WIN32_THREAD_H
    123111
    124112// Local Variables:
Note: See TracChangeset for help on using the changeset viewer.