Changeset 4:d061ad3be7fd in xplcommon for src/xplcommon/posix/Thread.h


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

Added support for a waitable event for POSIX and a test program

File:
1 edited

Legend:

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

    r3 r4  
    3333
    3434#include <pthread.h>
     35#include <unistd.h>
    3536
    3637//------------------------------------------------------------------------------
     
    4546class Thread
    4647{
     48public:
     49    /**
     50     * Sleep for the given number of milliseconds.
     51     */
     52    static void sleep(unsigned millis);
     53
    4754private:
    4855    /**
     
    8491//------------------------------------------------------------------------------
    8592
     93inline void Thread::sleep(unsigned millis)
     94{
     95    usleep(static_cast<useconds_t>(millis)*1000);
     96}
     97
     98//------------------------------------------------------------------------------
     99
    86100inline Thread::~Thread()
    87101{
Note: See TracChangeset for help on using the changeset viewer.