summaryrefslogtreecommitdiff
path: root/src/Thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Thread.h')
-rw-r--r--src/Thread.h43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/Thread.h b/src/Thread.h
index 3948f56..55ebf1c 100644
--- a/src/Thread.h
+++ b/src/Thread.h
@@ -9,7 +9,6 @@
* Douglas M. Pase - initial API and implementation *
*******************************************************************************/
-
#if !defined(Thread_h)
#define Thread_h
@@ -19,35 +18,39 @@
class Thread {
public:
- Thread();
- ~Thread();
+ Thread();
+ ~Thread();
- virtual int run() = 0;
+ virtual int run() = 0;
- int start();
- int wait();
- int thread_count() { return Thread::count; }
- int thread_id() { return id; }
+ int start();
+ int wait();
+ int thread_count() {
+ return Thread::count;
+ }
+ int thread_id() {
+ return id;
+ }
- static void exit();
+ static void exit();
protected:
- void lock();
- void unlock();
- static void global_lock();
- static void global_unlock();
+ void lock();
+ void unlock();
+ static void global_lock();
+ static void global_unlock();
private:
- static void* start_routine(void *);
- static Lock _global_lock;
+ static void* start_routine(void *);
+ static Lock _global_lock;
- Lock object_lock;
+ Lock object_lock;
- pthread_t thread;
+ pthread_t thread;
- static int count;
- int id;
- int lock_obj;
+ static int count;
+ int id;
+ int lock_obj;
};
#endif