f32f18a60a906f4a3742ace2207ad5f1c98c0ddb
[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 #include <winsock2.h>
11 #include <ws2tcpip.h>
12
13 extern "C" {
14 #include <afs/param.h>
15 #include <afs/stds.h>
16 }
17
18 #include "TaAfsAdmSvrClientInternal.h"
19
20
21 /*
22  * VARIABLES __________________________________________________________________
23  *
24  */
25
26 static struct
27    {
28    LPCRITICAL_SECTION pcs;
29    } l;
30
31
32 /*
33  * ROUTINES ___________________________________________________________________
34  *
35  */
36
37 void ADMINAPI asc_Enter (void)
38 {
39    if (!l.pcs)
40       {
41       l.pcs = New (CRITICAL_SECTION);
42       InitializeCriticalSection (l.pcs);
43       }
44    EnterCriticalSection (l.pcs);
45 }
46
47
48 void ADMINAPI asc_Leave (void)
49 {
50    LeaveCriticalSection (l.pcs);
51 }
52
53
54 LPCRITICAL_SECTION ADMINAPI asc_GetCriticalSection (void)
55 {
56    if (!l.pcs)
57       {
58       l.pcs = New (CRITICAL_SECTION);
59       InitializeCriticalSection (l.pcs);
60       }
61    return l.pcs;
62 }
63