13 #ifndef _MpMMTimerPosix_h_ 14 #define _MpMMTimerPosix_h_ 19 #include <semaphore.h> 24 #include <utl/UtlDefs.h> 26 #include <os/OsMutex.h> 29 #warning PosixTimer is not implimented in MacOS X 47 static const char *
const TYPE;
67 OsStatus
run(
unsigned usecPeriodic);
85 OsStatus
getPeriodRange(
unsigned* pMinUSecs,
unsigned* pMaxUSecs = NULL);
123 void signalHandler(
int signum, siginfo_t *siginfo,
void *context);
146 #endif //_MpMMTimerPosix_h_ High-precision periodic timer (MultiMedia timer) base class.
Definition: MpMMTimer.h:44
static PosixSignalReg sPosixTimerReg
Definition: MpMMTimerPosix.h:137
MMTimerType
Definition: MpMMTimer.h:48
int getSignalNum() const
Get number of the signaling signal.
Definition: MpMMTimerPosix.cpp:323
~MpMMTimerPosix()
Definition: MpMMTimerPosix.cpp:81
OsTime getAbsFireTime() const
Definition: MpMMTimerPosix.cpp:216
void callback()
Definition: MpMMTimerPosix.cpp:227
UtlBoolean mbTimerStarted
Is timer started.
Definition: MpMMTimerPosix.h:128
OsStatus getPeriodRange(unsigned *pMinUSecs, unsigned *pMaxUSecs=NULL)
Get the range of timer periods that can be generated.
Definition: MpMMTimerPosix.cpp:166
OsStatus waitForNextTick()
Definition: MpMMTimerPosix.cpp:192
OsStatus setNotification(OsNotification *notification)
Set notification for the OsNotification timer type.
Definition: MpMMTimerPosix.cpp:221
Posix implementation of periodic timer.
Definition: MpMMTimerPosix.h:41
int blockThreadSig()
Definition: MpMMTimerPosix.cpp:328
static void signalHandler(int signum, siginfo_t *siginfo, void *context)
Signal callback.
Definition: MpMMTimerPosix.cpp:299
PosixSignalReg(int sigNum, void(*)(int, siginfo_t *, void *))
Definition: MpMMTimerPosix.cpp:312
static void * threadIoWrapper(void *arg)
Definition: MpMMTimerPosix.cpp:250
struct sigaction mOldAction
Old signal action.
Definition: MpMMTimerPosix.h:116
OsStatus getResolution(unsigned &resolution)
Get resolution of timer in microseconds.
Definition: MpMMTimerPosix.cpp:178
pthread_t mThread
Sync-signal wait thread.
Definition: MpMMTimerPosix.h:138
OsStatus stop()
Stop periodical firing.
Definition: MpMMTimerPosix.cpp:143
Help class for signal registering.
Definition: MpMMTimerPosix.h:103
~PosixSignalReg()
Definition: MpMMTimerPosix.cpp:338
timer_t mTimer
Timer object.
Definition: MpMMTimerPosix.h:129
OsNotification * mpNotification
Notification object used to signal a tick of the timer.
Definition: MpMMTimerPosix.h:127
int mSigNum
Signal number.
Definition: MpMMTimerPosix.h:117
MpMMTimerPosix(MpMMTimer::MMTimerType type)
Definition: MpMMTimerPosix.cpp:62
sem_t mSyncSemaphore
Synchronization semaphore for linear operation.
Definition: MpMMTimerPosix.h:130
static const char *const TYPE
Definition: MpMMTimerPosix.h:45
int unblockThreadSig()
Definition: MpMMTimerPosix.cpp:333
sem_t mIoSem
Startup initialization semaphore.
Definition: MpMMTimerPosix.h:139
sigset_t mBlockSigMask
Block mask for only this signal.
Definition: MpMMTimerPosix.h:118
UtlBoolean mbTerminate
Should the timer thread exit?
Definition: MpMMTimerPosix.h:140
static PosixSignalReg * getSignalDescriptor()
Returns signal descriptor for thread blocking/unblocking operations.
Definition: MpMMTimerPosix.cpp:307
OsStatus run(unsigned usecPeriodic)
Start periodical firing.
Definition: MpMMTimerPosix.cpp:98