AnimatLab
2
Test
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
StdCriticalSection.h
Go to the documentation of this file.
1
7
// CTryEnterCS
9
//
10
// A ::TryEnterCriticalSection type thing that works on 9x
11
//
12
// Written by Olan Patrick Barnes (patrick@mfcfree.com)
13
// Copyright (c) 2001 Olan Patrick Barnes
14
//
15
// This code may be used in compiled form in any way you desire. This
16
// file may be redistributed by any means PROVIDING it is
17
// not sold for profit without the authors written consent, and
18
// providing that this notice and the authors name is included.
19
//
20
// This file is provided "as is" with no expressed or implied warranty.
21
// The author accepts no liability if it causes any damage to you or your
22
// computer whatsoever.
23
//
24
// Description:
25
//
26
// ::TryEnterCriticalSection() is only available on NT platforms, and you
27
// may need to support 9x. This is a custom critical section class that
28
// allows for "try-enter" logic. It operates 100% in user mode (this
29
// class does not use expensive kernel objects), making use of the
30
// ::InterlockedExchange() and ::GetCurrentThreadId() API's.
31
//
33
34
#pragma once
35
36
#ifndef CTRYENTERCS_H
37
#define CTRYENTERCS_H
38
39
namespace
StdUtils
40
{
50
class
STD_UTILS_PORT
CStdCriticalSection
51
{
52
public
:
53
CStdCriticalSection
();
54
~
CStdCriticalSection
();
55
56
virtual
bool
TryEnter() = 0;
57
virtual
bool
Leave() = 0;
58
};
59
60
CStdCriticalSection
STD_UTILS_PORT *Std_GetCriticalSection();
61
62
}
//StdUtils
63
64
#endif // CTRYENTERCS_H
StdUtils
Namespace for the standard utility objects.
Definition:
MarkupSTL.cpp:19
StdUtils::CStdCriticalSection
Standard critical section.
Definition:
StdCriticalSection.h:50
Libraries
StdUtils
StdCriticalSection.h
Generated on Tue Sep 29 2015 07:07:21 for AnimatLab by
1.8.10