Commit 6ce3881
committed
utils: Different lock initialisation for Windows
Rewrite code to initialise mutexes in Windows.
To allow static initialisation of mutex MCS locks were used.
However the implementation required potentially (in case of
contention) resource usages (Windows events) and more system
calls.
As before is there are no contention no system calls are
needed (except InitializeCriticalSection).
Advantages:
- reduced code;
- reduced tds_raw_mutex structure size;
- no allocation needed;
- less atomic operations needed in case of no contention.
Disadvantages:
- for systems till Vista on contention polling is used; however
there should not be much contention anyway and there should be
very few use cases of such old systems.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>1 parent 47e26a9 commit 6ce3881
File tree
5 files changed
+67
-246
lines changed- include/freetds
- src/utils
5 files changed
+67
-246
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 131 | + | |
| 132 | + | |
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
140 | | - | |
| 138 | + | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
145 | | - | |
146 | 143 | | |
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
150 | 147 | | |
151 | | - | |
| 148 | + | |
152 | 149 | | |
153 | | - | |
| 150 | + | |
| 151 | + | |
154 | 152 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
161 | 157 | | |
162 | 158 | | |
163 | | - | |
| 159 | + | |
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
167 | 163 | | |
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
171 | | - | |
| 167 | + | |
| 168 | + | |
172 | 169 | | |
173 | | - | |
| 170 | + | |
174 | 171 | | |
175 | 172 | | |
176 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
| 35 | + | |
33 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
34 | 44 | | |
35 | | - | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | | - | |
| 48 | + | |
39 | 49 | | |
40 | | - | |
41 | | - | |
| 50 | + | |
42 | 51 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
47 | 62 | | |
48 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
49 | 89 | | |
50 | | - | |
51 | | - | |
52 | 90 | | |
53 | 91 | | |
54 | 92 | | |
55 | | - | |
| 93 | + | |
56 | 94 | | |
57 | | - | |
58 | | - | |
| 95 | + | |
| 96 | + | |
59 | 97 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 98 | | |
68 | 99 | | |
69 | 100 | | |
| |||
0 commit comments