Debian Codegraph @

thread_win.h

raw symbols SCIP
1 /*
2 * Licensed under CLIFE license. See LICENCE.TXT
3 *
4 * Produced by: Jeff Lait
5 *
6 * CLIFE Development
7 *
8 * NAME: thread_win.h ( CLIFE, C++ )
9 *
10 * COMMENTS:
11 * Attempt at a threading class.
12 */
13
14 #ifndef __threadwin_h__
15 #define __threadwin_h__
16
17 #include "thread.h"
18 #define _THREAD_SAFE
19 #define _WIN32_WINNT 0x0400
20 #include <windows.h>
21
22 #ifdef max
23 #undef max
24 #endif
25 #ifdef min
26 #undef min
27 #endif
28
29 class THREAD_WIN : public THREAD
30 {
31 public:
32 // (Re)starts this, invoking the given function as the main
33 // thread program.
34 virtual void start(THREADmainFunc func, void *data);
35
36 // Blocks until this is done
37 virtual void join();
38
39 // Terminates this thread.
40 virtual void kill();
41
42 THREAD_WIN();
43 virtual ~THREAD_WIN();
44 protected:
45 // Blocks until the thread is ready to process.
46 virtual void waittillimready();
47 virtual void iamdonenow();
48 virtual void jobsready();
49
50
51 CRITICAL_SECTION myCritSec;
52 HANDLE myDoneEvent;
53 HANDLE myStartEvent;
54 HANDLE mySelf;
55 };
56
57 #endif
58