Remove whitespace, update email addresses and URLs.
[kodak.git] / semaphore.h
1 //+----------------------------------------------------------------------------
2 //
3 // File:     semaphore.h
4 //
5 // Module:   
6 //
7 // Synopsis: 
8 //
9 // Author:       sgasch
10 //
11 // Created    8 Jun 1999
12 //
13 //+----------------------------------------------------------------------------
14
15 #ifndef _LOCK
16 #define _LOCK
17
18 class CCriticalSection
19 {
20
21 public:
22         CCriticalSection(void);
23         CCriticalSection(int iNumThreads);
24         ~CCriticalSection(void);
25         bool GetNumberConcurrentThreads(int *piAnswer);
26         bool SetNumberConcurrentThreads(int iNumber);
27         bool TryToEnter(void);
28         bool Enter(void);
29         bool Leave(void);
30
31 private:
32
33         bool CreateSemaphore(void);
34         bool RemoveSemaphore(void);
35
36         int m_hSem;
37         bool m_fInitialized;
38 };
39
40 #endif // _LOCK
41
42
43
44