File: thread_win.h

package info (click to toggle)
powder 117-1
  • links: PTS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 10,360 kB
  • ctags: 3,545
  • sloc: cpp: 55,002; makefile: 541; sh: 258; objc: 245; ansic: 107; csh: 54
file content (58 lines) | stat: -rw-r--r-- 1,057 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Licensed under CLIFE license.  See LICENCE.TXT  
 *
 * Produced by:	Jeff Lait
 *
 *      	CLIFE Development
 *
 * NAME:        thread_win.h ( CLIFE, C++ )
 *
 * COMMENTS:
 *	Attempt at a threading class.
 */

#ifndef __threadwin_h__
#define __threadwin_h__

#include "thread.h"
#define _THREAD_SAFE
#define _WIN32_WINNT 0x0400
#include <windows.h>

#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif

class THREAD_WIN : public THREAD
{
public:
    // (Re)starts this, invoking the given function as the main 
    // thread program.
    virtual void	 start(THREADmainFunc func, void *data);

    // Blocks until this is done
    virtual void	 join();

    // Terminates this thread.
    virtual void	 kill();
    
			 THREAD_WIN();
    virtual 		~THREAD_WIN();
protected:
    // Blocks until the thread is ready to process.
    virtual void	 waittillimready();
    virtual void	 iamdonenow();
    virtual void	 jobsready();


    CRITICAL_SECTION	 myCritSec;
    HANDLE		 myDoneEvent;
    HANDLE		 myStartEvent;
    HANDLE		 mySelf;
};

#endif