summaryrefslogtreecommitdiff
path: root/src/pal/src/include/pal/cs.hpp
blob: 76e268566b568220e87ae89baed232a63e5ec424 (plain)
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

///////////////////////////////////////////////////////////////////////////////
//
// File:
//     cs.cpp
//
// Purpose:
//     Header file for critical sections implementation
//

//     
///////////////////////////////////////////////////////////////////////////////

#ifndef _PAL_CS_HPP
#define _PAL_CS_HPP

#include "corunix.hpp"
#include "critsect.h"

namespace CorUnix
{   
    void CriticalSectionSubSysInitialize(void);
    
    void InternalInitializeCriticalSectionAndSpinCount(
        PCRITICAL_SECTION pCriticalSection,
        DWORD dwSpinCount,
        bool fInternal);
    
    void InternalEnterCriticalSection(
        CPalThread *pThread,
        CRITICAL_SECTION *pcs
        );
    
    void InternalLeaveCriticalSection(
        CPalThread *pThread,
        CRITICAL_SECTION *pcs
        );

    bool InternalTryEnterCriticalSection(
        CPalThread * pThread,
        PCRITICAL_SECTION pCriticalSection);

#ifdef _DEBUG
    void PALCS_ReportStatisticalData(void);
    void PALCS_DumpCSList();
#endif // _DEBUG
    
}

#endif // _PAL_CS_HPP