Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
XThreadSync.h
1
// xThreadSync.h: interface for the thread synchronization classes
2
//
3
//////////////////////////////////////////////////////////////////////
4
5
#if !defined(XTHREADSYNC_INCLUDE_H)
6
#define XTHREADSYNC_INCLUDE_H
7
8
#ifdef _MSC_VER
9
#pragma once
10
#endif
// _MSC_VER
11
12
#include "xosoperation.h"
13
14
BEGIN_MOOTOOLS_NAMESPACE
15
16
/////////////////////////////////////////////////////////////////////////////
17
// CXCriticalSection
18
19
class
DLL_TOOLSFUNCTION
CXCriticalSection
20
{
21
// Constructor
22
public
:
23
CXCriticalSection
();
24
virtual
~CXCriticalSection
();
25
26
bool
Unlock();
27
bool
Lock();
28
bool
IsLocked()
const
;
29
30
private
:
31
xCriticalSection
section;
32
int
count;
33
};
34
35
/////////////////////////////////////////////////////////////////////////////
36
// CXSingleLock
37
class
DLL_TOOLSFUNCTION
CXSingleLock
38
{
39
// Constructors
40
public
:
41
// Useful for handling lock in method that require to lock the thread safe guard while a return data is used.
42
// CXSingleLock lock;
43
// void *data = AClass::GetData(&lock); // Data can be used safely until lock is valid.
44
explicit
CXSingleLock
();
45
explicit
CXSingleLock
(
CXCriticalSection
*
pCriticalSection
,
bool
bInitialLock
=
true
);
46
virtual
~CXSingleLock
();
47
48
// Operations
49
void
Attach(
CXCriticalSection
*
pCriticalSection
);
// Attach and lock provided critical section. (Unlock any critical section already attached).
50
bool
Lock();
51
bool
Unlock();
52
53
protected
:
54
CXCriticalSection
*m_pObject;
55
bool
m_bAcquired;
56
};
57
58
END_MOOTOOLS_NAMESPACE
59
60
#endif
// !defined(XTHREADSYNC_INCLUDE_H)
C3DTPoint
The class defines an x, y, z 3D point which can use int, float or double.
Definition
3DPoint.h:27
CXCriticalSection
Definition
XThreadSync.h:20
CXSingleLock
Definition
XThreadSync.h:38
VS2022-PolygonCruncherSDK-Full-IO
SDK
Includes
XThreadSync.h
Generated by
1.9.8