< prev index next >

src/os/posix/vm/os_posix.hpp

Print this page

        

*** 87,92 **** --- 87,108 ---- private: void restore(); sigjmp_buf _jmpbuf; }; + class PosixSemaphore : public Semaphore { + public: + PosixSemaphore(uint value = 0) : Semaphore(value) {} + + bool trywait(); + bool timedwait(unsigned int sec, int nsec) { + return timedwait(create_timespec(sec, nsec)); + } + + private: + bool timedwait(struct timespec ts); + + // OS specific implementation to create a timespec suitable for semaphores. + static struct timespec create_timespec(unsigned int set, int nsec); + }; + #endif // OS_POSIX_VM_OS_POSIX_HPP
< prev index next >