Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

core/thread.h

Go to the documentation of this file.
00001 
00015 #ifndef _THREAD_H_
00016 #define _THREAD_H_
00017 
00018 #include <assert.h>
00019 #include <pthread.h>
00020 
00032 class Thread
00033 {
00034     public:
00035         Thread();
00036         virtual ~Thread();
00037         int Start(void * arg);
00038     protected:
00039         int Run(void * arg);
00040         static void *EntryPoint(void*);
00041         virtual void Setup();
00042         virtual void Execute(void*);
00047         void *Arg() const {return Arg_;}
00053         void Arg(void* a){Arg_ = a;}
00058         void Mutex(pthread_mutex_t *a){p_mutex = a;}
00063         pthread_mutex_t *Mutex() const {return p_mutex;}
00064         virtual void Lock();
00065         virtual void Unlock();
00066     private:
00067         pthread_t         a_thread;
00068         //pthread_attr_t    a_thread_attribute;
00070         void              *Arg_;
00072         pthread_mutex_t   *p_mutex;
00073 
00074 };
00075 
00076 #endif

Generated at Thu May 30 15:12:33 2002 for Freeagent by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001