9.10.2011 - stable backup commit

This commit is contained in:
peri4
2011-10-09 22:23:52 +04:00
parent 29190ea465
commit 39ec9cac5c
39 changed files with 1170 additions and 512 deletions

View File

@@ -1,7 +1,6 @@
#ifndef PITHREAD_H
#define PITHREAD_H
#include <pthread.h>
#include <signal.h>
#include "pimutex.h"
@@ -33,7 +32,7 @@ public:
bool start(int timer_delay = -1);
bool startOnce();
void stop(bool wait = false) {terminating = true; if (wait) waitForFinish();}
void terminate() {kill(thread, SIGKILL); end(); running = false;}
void terminate(bool hard = false);
void setPriority(PIThread::Priority prior);
PIThread::Priority priority() const {return priority_;}
bool isRunning() const {return running;}
@@ -55,10 +54,14 @@ protected:
volatile bool terminating, running, lockRun;
int timer, policy;
pthread_t thread;
PIMutex mutex_;
sched_param sparam;
PIThread::Priority priority_;
#ifndef WINDOWS
pthread_t thread;
sched_param sparam;
#else
void * thread;
#endif
};