Changeset 35:f8a5b321d0c3 in xplcommon for src/xplcommon/posix/Thread.h


Ignore:
Timestamp:
01/03/13 06:57:15 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added support for detached threads

File:
1 edited

Legend:

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

    r4 r35  
    5959
    6060    /**
     61     * Indicate if the thread is detached or not.
     62     */
     63    bool detached;
     64
     65    /**
    6166     * The posix thread handle.
    6267     */
     
    6469
    6570public:
     71    /**
     72     * Construct the thread
     73     */
     74    Thread(bool detached = false);
     75
    6676    /**
    6777     * Virtual destructor.
     
    98108//------------------------------------------------------------------------------
    99109
    100 inline Thread::~Thread()
     110inline Thread::Thread(bool detached) :
     111    detached(detached)
    101112{
    102113}
     
    104115//------------------------------------------------------------------------------
    105116
    106 inline bool Thread::start()
     117inline Thread::~Thread()
    107118{
    108     return pthread_create(&thread, 0, &threadFn, this)>=0;
    109119}
    110120
Note: See TracChangeset for help on using the changeset viewer.