windows-build-updates-20030314
[openafs.git] / src / WINNT / afsadmsvr / TaAfsAdmSvrClientInternal.cpp
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 extern "C" {
11 #include <afs/param.h>
12 #include <afs/stds.h>
13 }
14
15 #include "TaAfsAdmSvrClientInternal.h"
16
17
18 /*
19  * VARIABLES __________________________________________________________________
20  *
21  */
22
23 static struct
24    {
25    LPCRITICAL_SECTION pcs;
26    } l;
27
28
29 /*
30  * ROUTINES ___________________________________________________________________
31  *
32  */
33
34 void ADMINAPI asc_Enter (void)
35 {
36    if (!l.pcs)
37       {
38       l.pcs = New (CRITICAL_SECTION);
39       InitializeCriticalSection (l.pcs);
40       }
41    EnterCriticalSection (l.pcs);
42 }
43
44
45 void ADMINAPI asc_Leave (void)
46 {
47    LeaveCriticalSection (l.pcs);
48 }
49
50
51 LPCRITICAL_SECTION ADMINAPI asc_GetCriticalSection (void)
52 {
53    if (!l.pcs)
54       {
55       l.pcs = New (CRITICAL_SECTION);
56       InitializeCriticalSection (l.pcs);
57       }
58    return l.pcs;
59 }
60