Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

thread.h

Go to the documentation of this file.
00001 
00003 
00004 #ifndef header_thread
00005 #define header_thread
00006 
00007 class CL_Runnable
00008 //: Thread callback interface.
00009 // When a thread is created, it will call run() in its attached CL_Runnable interface.
00010 {
00011 public:
00012         virtual void run()=0;
00013         // Called when a thread is run.
00014 };
00015 
00016 class CL_Thread
00017 {
00018 public:
00019         static CL_Thread *create(CL_Runnable *runnable);
00020         // Create a thread that uses the CL_Runnable callback interface.
00022 
00023         static CL_Thread *create(int (*func)(void*), void* value);
00024         // Create a thread that calls the function specified, with the value specified.
00027         
00028         virtual ~CL_Thread () {;}
00029         
00030         virtual void start()=0;
00031         // Starts the thread.
00032 
00033         virtual void terminate()=0;
00034         // Terminate the thread. (use with caution under win98)
00035 
00036         virtual void wait()=0;
00037         // Wait until the thread finishes its execution.
00038 };
00039 
00040 #endif

Generated at Wed Apr 4 19:54:04 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001