xref: /reactos/sdk/include/psdk/concurrencysal.h (revision c2c66aff)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * concurrencysal.h
3*c2c66affSColin Finck  *
4*c2c66affSColin Finck  * Standard Annotation Language (SAL) definitions for synchronisation
5*c2c66affSColin Finck  *
6*c2c66affSColin Finck  * This file is part of the ReactOS PSDK package.
7*c2c66affSColin Finck  *
8*c2c66affSColin Finck  * Contributors:
9*c2c66affSColin Finck  *   Timo Kreuzer (timo.kreuzer@reactos.org)
10*c2c66affSColin Finck  *
11*c2c66affSColin Finck  * THIS SOFTWARE IS NOT COPYRIGHTED
12*c2c66affSColin Finck  *
13*c2c66affSColin Finck  * This source code is offered for use in the public domain. You may
14*c2c66affSColin Finck  * use, modify or distribute it freely.
15*c2c66affSColin Finck  *
16*c2c66affSColin Finck  * This code is distributed in the hope that it will be useful but
17*c2c66affSColin Finck  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18*c2c66affSColin Finck  * DISCLAIMED. This includes but is not limited to warranties of
19*c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20*c2c66affSColin Finck  *
21*c2c66affSColin Finck  */
22*c2c66affSColin Finck 
23*c2c66affSColin Finck #if defined(_PREFAST_)
24*c2c66affSColin Finck 
25*c2c66affSColin Finck #define _Benign_race_begin_ __pragma(warning(push)) __pragma(warning(disable:26100 26101 26150 26130 26180 26131 26181 28112))
26*c2c66affSColin Finck #define _Benign_race_end_ __pragma(warning(pop))
27*c2c66affSColin Finck #define _No_competing_thread_begin_ __pragma(warning(push)) __pragma(warning(disable:26100 26101 26150 26101 26151 26110 26160 26130 26180 26131 26181 28112))
28*c2c66affSColin Finck #define _No_competing_thread_end_ __pragma(warning(pop))
29*c2c66affSColin Finck 
30*c2c66affSColin Finck #define _Acquires_exclusive_lock_(lock)
31*c2c66affSColin Finck #define _Acquires_lock_(lock)
32*c2c66affSColin Finck #define _Acquires_nonreentrant_lock_(lock)
33*c2c66affSColin Finck #define _Acquires_shared_lock_(lock)
34*c2c66affSColin Finck #define _Analysis_assume_lock_acquired_(lock)
35*c2c66affSColin Finck #define _Analysis_assume_lock_released_(lock)
36*c2c66affSColin Finck #define _Analysis_assume_lock_held_(lock)
37*c2c66affSColin Finck #define _Analysis_assume_lock_not_held_(lock)
38*c2c66affSColin Finck #define _Analysis_assume_same_lock_(lock1, lock2)
39*c2c66affSColin Finck #define _Analysis_suppress_lock_checking_(lock)
40*c2c66affSColin Finck #define _Create_lock_level_(level)
41*c2c66affSColin Finck #define _Csalcat1_(x,y)
42*c2c66affSColin Finck #define _Csalcat2_(x,y)
43*c2c66affSColin Finck #define _Function_ignore_lock_checking_(lock)
44*c2c66affSColin Finck #define _Guarded_by_(lock)
45*c2c66affSColin Finck #define _Has_lock_kind_(kind)
46*c2c66affSColin Finck #define _Has_lock_level_(level)
47*c2c66affSColin Finck #define _Interlocked_
48*c2c66affSColin Finck #define _Internal_lock_level_order_(a,b)
49*c2c66affSColin Finck #define _Lock_level_order_(a,b)
50*c2c66affSColin Finck #define _No_competing_thread_
51*c2c66affSColin Finck #define _Post_same_lock_(lock1,lock2)
52*c2c66affSColin Finck #define _Releases_exclusive_lock_(lock)
53*c2c66affSColin Finck #define _Releases_lock_(lock)
54*c2c66affSColin Finck #define _Releases_nonreentrant_lock_(lock)
55*c2c66affSColin Finck #define _Releases_shared_lock_(lock)
56*c2c66affSColin Finck #define _Requires_exclusive_lock_held_(lock)
57*c2c66affSColin Finck #define _Requires_shared_lock_held_(lock)
58*c2c66affSColin Finck #define _Requires_lock_held_(lock)
59*c2c66affSColin Finck #define _Requires_lock_not_held_(lock)
60*c2c66affSColin Finck #define _Requires_no_locks_held_
61*c2c66affSColin Finck #define _Write_guarded_by_(lock)
62*c2c66affSColin Finck 
63*c2c66affSColin Finck 
64*c2c66affSColin Finck const char _Lock_kind_mutex_[] = "";
65*c2c66affSColin Finck const char _Lock_kind_event_[] = "";
66*c2c66affSColin Finck const char _Lock_kind_semaphore_[] = "";
67*c2c66affSColin Finck const char _Lock_kind_spin_lock_[] = "";
68*c2c66affSColin Finck const char _Lock_kind_critical_section_[] = "";
69*c2c66affSColin Finck 
70*c2c66affSColin Finck #else /* _PREFAST_ */
71*c2c66affSColin Finck 
72*c2c66affSColin Finck #define _Benign_race_begin_ __pragma(warning(push))
73*c2c66affSColin Finck #define _Benign_race_end_ __pragma(warning(pop))
74*c2c66affSColin Finck #define _No_competing_thread_begin_ __pragma(warning(push))
75*c2c66affSColin Finck #define _No_competing_thread_end_ __pragma(warning(pop))
76*c2c66affSColin Finck 
77*c2c66affSColin Finck #define _Acquires_exclusive_lock_(lock)
78*c2c66affSColin Finck #define _Acquires_lock_(lock)
79*c2c66affSColin Finck #define _Acquires_nonreentrant_lock_(lock)
80*c2c66affSColin Finck #define _Acquires_shared_lock_(lock)
81*c2c66affSColin Finck #define _Analysis_assume_lock_acquired_(lock)
82*c2c66affSColin Finck #define _Analysis_assume_lock_released_(lock)
83*c2c66affSColin Finck #define _Analysis_assume_lock_held_(lock)
84*c2c66affSColin Finck #define _Analysis_assume_lock_not_held_(lock)
85*c2c66affSColin Finck #define _Analysis_assume_same_lock_(lock1, lock2)
86*c2c66affSColin Finck #define _Analysis_suppress_lock_checking_(lock)
87*c2c66affSColin Finck #define _Create_lock_level_(level)
88*c2c66affSColin Finck #define _Csalcat1_(x,y)
89*c2c66affSColin Finck #define _Csalcat2_(x,y)
90*c2c66affSColin Finck #define _Function_ignore_lock_checking_(lock)
91*c2c66affSColin Finck #define _Guarded_by_(lock)
92*c2c66affSColin Finck #define _Has_lock_kind_(kind)
93*c2c66affSColin Finck #define _Has_lock_level_(level)
94*c2c66affSColin Finck #define _Interlocked_
95*c2c66affSColin Finck #define _Internal_lock_level_order_(a,b)
96*c2c66affSColin Finck #define _Lock_level_order_(a,b)
97*c2c66affSColin Finck #define _No_competing_thread_
98*c2c66affSColin Finck #define _Post_same_lock_(lock1,lock2)
99*c2c66affSColin Finck #define _Releases_exclusive_lock_(lock)
100*c2c66affSColin Finck #define _Releases_lock_(lock)
101*c2c66affSColin Finck #define _Releases_nonreentrant_lock_(lock)
102*c2c66affSColin Finck #define _Releases_shared_lock_(lock)
103*c2c66affSColin Finck #define _Requires_exclusive_lock_held_(lock)
104*c2c66affSColin Finck #define _Requires_shared_lock_held_(lock)
105*c2c66affSColin Finck #define _Requires_lock_held_(lock)
106*c2c66affSColin Finck #define _Requires_lock_not_held_(lock)
107*c2c66affSColin Finck #define _Requires_no_locks_held_
108*c2c66affSColin Finck #define _Write_guarded_by_(lock)
109*c2c66affSColin Finck 
110*c2c66affSColin Finck #endif /* _PREFAST_ */
111*c2c66affSColin Finck 
112*c2c66affSColin Finck #if 0 /* Check these */
113*c2c66affSColin Finck #define _Internal_set_lock_count_(lock, count)
114*c2c66affSColin Finck #define _Internal_set_lock_count_to_zero_(lock)
115*c2c66affSColin Finck #define _Internal_set_lock_count_to_one_(lock)
116*c2c66affSColin Finck #endif // 0
117*c2c66affSColin Finck 
118