blob: 491d047cc7a53dcbac6cc8809030ed4b62b41628 [file] [log] [blame]
sewardjaf44c822007-11-25 14:01:38 +00001/*
2 This file is part of drd, a data race detector.
3
sewardj85642922008-01-14 11:54:56 +00004 Copyright (C) 2006-2008 Bart Van Assche
sewardjaf44c822007-11-25 14:01:38 +00005 bart.vanassche@gmail.com
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307, USA.
21
22 The GNU General Public License is contained in the file COPYING.
23*/
24
25
26#include "drd_error.h"
27#include "drd_mutex.h"
28#include "drd_suppression.h"
sewardj721ad7b2007-11-30 08:30:29 +000029#include "priv_drd_clientreq.h"
sewardjaf44c822007-11-25 14:01:38 +000030#include "pub_tool_errormgr.h" // VG_(maybe_record_error)()
31#include "pub_tool_libcassert.h" // tl_assert()
32#include "pub_tool_libcprint.h" // VG_(printf)()
33#include "pub_tool_machine.h" // VG_(get_IP)()
34#include "pub_tool_threadstate.h" // VG_(get_running_tid)()
35
36
37// Type definitions.
38
39struct mutex_info
40{
41 Addr mutex; // Pointer to client mutex.
42 SizeT size; // Size in bytes of client-side object.
sewardj721ad7b2007-11-30 08:30:29 +000043 MutexT mutex_type; // pthread_mutex_t or pthread_spinlock_t.
sewardjaf44c822007-11-25 14:01:38 +000044 int recursion_count; // 0 if free, >= 1 if locked.
45 DrdThreadId owner; // owner if locked, last owner if free.
46 VectorClock vc; // vector clock associated with last unlock.
47};
48
49
sewardj347eeba2008-01-21 14:19:07 +000050// Local functions.
51
bart5357fcb2008-02-27 15:46:00 +000052static Bool mutex_is_locked(struct mutex_info* const p);
sewardj347eeba2008-01-21 14:19:07 +000053static void mutex_destroy(struct mutex_info* const p);
54
55
sewardjaf44c822007-11-25 14:01:38 +000056// Local variables.
57
58static Bool s_trace_mutex;
59static ULong s_mutex_lock_count;
60struct mutex_info s_mutex[256];
61
62
63// Function definitions.
64
65void mutex_set_trace(const Bool trace_mutex)
66{
67 tl_assert(!! trace_mutex == trace_mutex);
68 s_trace_mutex = trace_mutex;
69}
70
71static
72void mutex_initialize(struct mutex_info* const p,
73 const Addr mutex,
sewardj721ad7b2007-11-30 08:30:29 +000074 const SizeT size,
75 const MutexT mutex_type)
sewardjaf44c822007-11-25 14:01:38 +000076{
77 tl_assert(mutex != 0);
78 tl_assert(size > 0);
bart5357fcb2008-02-27 15:46:00 +000079#if 0
sewardj721ad7b2007-11-30 08:30:29 +000080 tl_assert(mutex_type == mutex_type_mutex
81 || mutex_type == mutex_type_spinlock);
bart5357fcb2008-02-27 15:46:00 +000082#endif
sewardjaf44c822007-11-25 14:01:38 +000083
84 p->mutex = mutex;
85 p->size = size;
sewardj721ad7b2007-11-30 08:30:29 +000086 p->mutex_type = mutex_type;
sewardjaf44c822007-11-25 14:01:38 +000087 p->recursion_count = 0;
88 p->owner = DRD_INVALID_THREADID;
89 vc_init(&p->vc, 0, 0);
90}
91
92static
sewardj721ad7b2007-11-30 08:30:29 +000093struct mutex_info*
94mutex_get_or_allocate(const Addr mutex,
95 const SizeT size,
96 const MutexT mutex_type)
sewardjaf44c822007-11-25 14:01:38 +000097{
98 int i;
sewardj721ad7b2007-11-30 08:30:29 +000099
bart5357fcb2008-02-27 15:46:00 +0000100#if 0
sewardj721ad7b2007-11-30 08:30:29 +0000101 tl_assert(mutex_type == mutex_type_mutex
102 || mutex_type == mutex_type_spinlock);
bart5357fcb2008-02-27 15:46:00 +0000103#endif
sewardj721ad7b2007-11-30 08:30:29 +0000104
sewardjaf44c822007-11-25 14:01:38 +0000105 for (i = 0; i < sizeof(s_mutex)/sizeof(s_mutex[0]); i++)
sewardj721ad7b2007-11-30 08:30:29 +0000106 {
sewardjaf44c822007-11-25 14:01:38 +0000107 if (s_mutex[i].mutex == mutex)
sewardj721ad7b2007-11-30 08:30:29 +0000108 {
bart5357fcb2008-02-27 15:46:00 +0000109 if (s_mutex[i].mutex_type != mutex_type)
110 {
111 VG_(message)(Vg_DebugMsg, "??? mutex %p: type changed from %d into %d",
112 s_mutex[i].mutex, s_mutex[i].mutex_type, mutex_type);
113 }
sewardj721ad7b2007-11-30 08:30:29 +0000114 tl_assert(s_mutex[i].mutex_type == mutex_type);
115 tl_assert(s_mutex[i].size == size);
sewardjaf44c822007-11-25 14:01:38 +0000116 return &s_mutex[i];
sewardj721ad7b2007-11-30 08:30:29 +0000117 }
118 }
sewardjaf44c822007-11-25 14:01:38 +0000119 for (i = 0; i < sizeof(s_mutex)/sizeof(s_mutex[0]); i++)
120 {
121 if (s_mutex[i].mutex == 0)
122 {
bartab7a6442008-02-25 19:46:14 +0000123 if (drd_is_any_suppressed(mutex, mutex + size))
124 {
barte883bc82008-02-26 19:13:04 +0000125 GenericErrInfo GEI;
bartab7a6442008-02-25 19:46:14 +0000126 VG_(maybe_record_error)(VG_(get_running_tid)(),
barte883bc82008-02-26 19:13:04 +0000127 GenericErr,
bartab7a6442008-02-25 19:46:14 +0000128 VG_(get_IP)(VG_(get_running_tid)()),
129 "Not a mutex",
barte883bc82008-02-26 19:13:04 +0000130 &GEI);
bartab7a6442008-02-25 19:46:14 +0000131 return 0;
132 }
sewardj721ad7b2007-11-30 08:30:29 +0000133 mutex_initialize(&s_mutex[i], mutex, size, mutex_type);
sewardjaf44c822007-11-25 14:01:38 +0000134 drd_start_suppression(mutex, mutex + size,
135 mutex_get_typename(&s_mutex[i]));
136 return &s_mutex[i];
137 }
138 }
139 tl_assert(0);
140 return 0;
141}
142
sewardj721ad7b2007-11-30 08:30:29 +0000143struct mutex_info*
144mutex_init(const Addr mutex, const SizeT size, const MutexT mutex_type)
sewardjaf44c822007-11-25 14:01:38 +0000145{
146 struct mutex_info* mutex_p;
147
sewardjaf44c822007-11-25 14:01:38 +0000148 if (s_trace_mutex)
149 {
150 const ThreadId vg_tid = VG_(get_running_tid)();
151 const DrdThreadId drd_tid = VgThreadIdToDrdThreadId(vg_tid);
152 VG_(message)(Vg_DebugMsg,
153 "drd_post_mutex_init tid = %d/%d, %s 0x%lx",
154 vg_tid, drd_tid,
sewardj347eeba2008-01-21 14:19:07 +0000155 mutex_type_name(mutex_type),
sewardjaf44c822007-11-25 14:01:38 +0000156 mutex);
157 }
158
bart5357fcb2008-02-27 15:46:00 +0000159#if 0
sewardj347eeba2008-01-21 14:19:07 +0000160 tl_assert(mutex_type == mutex_type_mutex
161 || mutex_type == mutex_type_spinlock);
bart5357fcb2008-02-27 15:46:00 +0000162#endif
163
sewardj347eeba2008-01-21 14:19:07 +0000164 mutex_p = mutex_get(mutex);
165 if (mutex_p)
166 {
167 const ThreadId vg_tid = VG_(get_running_tid)();
168 MutexErrInfo MEI
169 = { mutex_p->mutex, mutex_p->recursion_count, mutex_p->owner };
170 VG_(maybe_record_error)(vg_tid,
171 MutexErr,
172 VG_(get_IP)(vg_tid),
173 "Mutex reinitialization",
174 &MEI);
175 mutex_destroy(mutex_p);
176 }
177 mutex_p = mutex_get_or_allocate(mutex, size, mutex_type);
178
sewardjaf44c822007-11-25 14:01:38 +0000179 return mutex_p;
180}
181
sewardj347eeba2008-01-21 14:19:07 +0000182static void mutex_destroy(struct mutex_info* const p)
sewardjaf44c822007-11-25 14:01:38 +0000183{
184 if (s_trace_mutex)
185 {
186 const ThreadId vg_tid = VG_(get_running_tid)();
187 const DrdThreadId drd_tid = VgThreadIdToDrdThreadId(vg_tid);
188 VG_(message)(Vg_DebugMsg,
189 "drd_pre_mutex_destroy tid = %d/%d, %s 0x%lx",
190 vg_tid, drd_tid,
191 mutex_get_typename(p),
192 p->mutex);
193 }
194
bart5357fcb2008-02-27 15:46:00 +0000195 if (mutex_is_locked(p))
196 {
197 MutexErrInfo MEI = { p->mutex, p->recursion_count, p->owner };
198 VG_(maybe_record_error)(VG_(get_running_tid)(),
199 MutexErr,
200 VG_(get_IP)(VG_(get_running_tid)()),
201 "Destroying locked mutex",
202 &MEI);
203 }
204
sewardjaf44c822007-11-25 14:01:38 +0000205 drd_finish_suppression(p->mutex, p->mutex + p->size);
206
207 vc_cleanup(&p->vc);
208 p->mutex = 0;
209}
210
sewardj347eeba2008-01-21 14:19:07 +0000211void mutex_pre_destroy(struct mutex_info* const p)
212{
213 return mutex_destroy(p);
214}
215
216void mutex_post_destroy(const Addr mutex)
217{
218 struct mutex_info* p;
219
220 p = mutex_get(mutex);
221 tl_assert(p);
222 if (p)
223 {
224 if (mutex_get_recursion_count(mutex) > 0)
225 {
226 const ThreadId vg_tid = VG_(get_running_tid)();
227 MutexErrInfo MEI = { p->mutex, p->recursion_count, p->owner };
228 VG_(maybe_record_error)(vg_tid,
229 MutexErr,
230 VG_(get_IP)(vg_tid),
231 "Destroying locked mutex",
232 &MEI);
233 }
234 mutex_pre_destroy(p);
235 }
236}
237
sewardjaf44c822007-11-25 14:01:38 +0000238struct mutex_info* mutex_get(const Addr mutex)
239{
240 int i;
241 for (i = 0; i < sizeof(s_mutex)/sizeof(s_mutex[0]); i++)
242 if (s_mutex[i].mutex == mutex)
243 return &s_mutex[i];
244 return 0;
245}
246
bart8bba1f72008-02-27 16:13:05 +0000247/** Called before pthread_mutex_lock() is invoked. If a data structure for
248 * the client-side object was not yet created, do this now. Also check whether
249 * an attempt is made to lock recursively a synchronization object that must
250 * not be locked recursively.
251 */
252void mutex_pre_lock(const Addr mutex, const SizeT size, MutexT mutex_type)
253{
254 struct mutex_info* p = mutex_get(mutex);
255 if (p == 0)
256 {
257 mutex_init(mutex, size, mutex_type);
258 p = mutex_get(mutex);
259 }
260 tl_assert(p);
261
262 if (p->owner == thread_get_running_tid()
263 && p->recursion_count >= 1
264 && mutex_type != mutex_type_recursive_mutex)
265 {
266 MutexErrInfo MEI = { p->mutex, p->recursion_count, p->owner };
267 VG_(maybe_record_error)(VG_(get_running_tid)(),
268 MutexErr,
269 VG_(get_IP)(VG_(get_running_tid)()),
270 "Recursive locking not allowed",
271 &MEI);
272 }
273}
274
sewardjaf44c822007-11-25 14:01:38 +0000275/**
276 * Update mutex_info state when locking the pthread_mutex_t mutex.
277 * Note: this function must be called after pthread_mutex_lock() has been
278 * called, or a race condition is triggered !
279 */
bart8bba1f72008-02-27 16:13:05 +0000280int mutex_post_lock(const Addr mutex, const SizeT size, MutexT mutex_type)
sewardjaf44c822007-11-25 14:01:38 +0000281{
282 const DrdThreadId drd_tid = VgThreadIdToDrdThreadId(VG_(get_running_tid)());
sewardj721ad7b2007-11-30 08:30:29 +0000283 struct mutex_info* const p = mutex_get_or_allocate(mutex, size, mutex_type);
sewardjaf44c822007-11-25 14:01:38 +0000284
285 if (s_trace_mutex)
286 {
287 const ThreadId tid = DrdThreadIdToVgThreadId(drd_tid);
288 VG_(message)(Vg_DebugMsg,
289 "drd_post_mutex_lock tid = %d/%d, %s 0x%lx rc %d owner %d",
290 tid,
291 drd_tid,
292 mutex_get_typename(p),
293 mutex,
294 p ? p->recursion_count : 0,
295 p ? p->owner : VG_INVALID_THREADID);
296 }
297
bartab7a6442008-02-25 19:46:14 +0000298 if (p == 0)
299 {
barte883bc82008-02-26 19:13:04 +0000300 GenericErrInfo GEI;
bartab7a6442008-02-25 19:46:14 +0000301 VG_(maybe_record_error)(VG_(get_running_tid)(),
barte883bc82008-02-26 19:13:04 +0000302 GenericErr,
bartab7a6442008-02-25 19:46:14 +0000303 VG_(get_IP)(VG_(get_running_tid)()),
304 "Not a mutex",
barte883bc82008-02-26 19:13:04 +0000305 &GEI);
bartab7a6442008-02-25 19:46:14 +0000306 return 0;
307 }
308
bart5357fcb2008-02-27 15:46:00 +0000309#if 0
sewardj721ad7b2007-11-30 08:30:29 +0000310 tl_assert(mutex_type == mutex_type_mutex
311 || mutex_type == mutex_type_spinlock);
bart5357fcb2008-02-27 15:46:00 +0000312#endif
313
sewardj721ad7b2007-11-30 08:30:29 +0000314 tl_assert(p->mutex_type == mutex_type);
315 tl_assert(p->size == size);
316
sewardjaf44c822007-11-25 14:01:38 +0000317 if (p->recursion_count == 0)
318 {
319 p->owner = drd_tid;
320 s_mutex_lock_count++;
321 }
322 else if (p->owner != drd_tid)
323 {
324 VG_(message)(Vg_DebugMsg,
325 "The impossible happened: mutex 0x%lx is locked"
326 " simultaneously by two threads (recursion count %d,"
327 " owners %d and %d) !",
328 p->mutex, p->recursion_count, p->owner, drd_tid);
sewardj347eeba2008-01-21 14:19:07 +0000329 p->owner = drd_tid;
sewardjaf44c822007-11-25 14:01:38 +0000330 }
331 p->recursion_count++;
332
333 if (p->recursion_count == 1)
334 {
bartab7a6442008-02-25 19:46:14 +0000335 const DrdThreadId last_owner = p->owner;
336
sewardjaf44c822007-11-25 14:01:38 +0000337 if (last_owner != drd_tid && last_owner != DRD_INVALID_THREADID)
338 thread_combine_vc2(drd_tid, mutex_get_last_vc(mutex));
339 thread_new_segment(drd_tid);
340 }
341
342 return p->recursion_count;
343}
344
345/**
346 * Update mutex_info state when unlocking the pthread_mutex_t mutex.
347 * Note: this function must be called before pthread_mutex_unlock() is called,
348 * or a race condition is triggered !
349 * @param mutex Pointer to pthread_mutex_t data structure in the client space.
350 * @param tid ThreadId of the thread calling pthread_mutex_unlock().
351 * @param vc Pointer to the current vector clock of thread tid.
352 */
sewardj721ad7b2007-11-30 08:30:29 +0000353int mutex_unlock(const Addr mutex, const MutexT mutex_type)
sewardjaf44c822007-11-25 14:01:38 +0000354{
355 const DrdThreadId drd_tid = VgThreadIdToDrdThreadId(VG_(get_running_tid)());
356 const ThreadId vg_tid = DrdThreadIdToVgThreadId(drd_tid);
357 const VectorClock* const vc = thread_get_vc(drd_tid);
358 struct mutex_info* const p = mutex_get(mutex);
359
360 if (s_trace_mutex)
361 {
362 VG_(message)(Vg_DebugMsg,
363 "drd_pre_mutex_unlock tid = %d/%d, %s 0x%lx rc %d",
364 vg_tid, drd_tid,
365 mutex_get_typename(p),
366 mutex,
367 p->recursion_count,
368 p->owner);
369 }
370
bart5357fcb2008-02-27 15:46:00 +0000371 if (p == 0)
bartab7a6442008-02-25 19:46:14 +0000372 {
barte883bc82008-02-26 19:13:04 +0000373 GenericErrInfo GEI;
bartab7a6442008-02-25 19:46:14 +0000374 VG_(maybe_record_error)(vg_tid,
barte883bc82008-02-26 19:13:04 +0000375 GenericErr,
bartab7a6442008-02-25 19:46:14 +0000376 VG_(get_IP)(vg_tid),
377 "Not a mutex",
barte883bc82008-02-26 19:13:04 +0000378 &GEI);
bartab7a6442008-02-25 19:46:14 +0000379 return 0;
380 }
381
bart5357fcb2008-02-27 15:46:00 +0000382 if (p->owner == DRD_INVALID_THREADID)
383 {
384 MutexErrInfo MEI = { p->mutex, p->recursion_count, p->owner };
385 VG_(maybe_record_error)(vg_tid,
386 MutexErr,
387 VG_(get_IP)(vg_tid),
388 "Mutex not locked",
389 &MEI);
390 return 0;
391 }
392
sewardjaf44c822007-11-25 14:01:38 +0000393 tl_assert(p);
bart5357fcb2008-02-27 15:46:00 +0000394 if (p->mutex_type != mutex_type)
395 {
396 VG_(message)(Vg_DebugMsg, "??? mutex %p: type changed from %d into %d",
397 p->mutex, p->mutex_type, mutex_type);
398 }
sewardj721ad7b2007-11-30 08:30:29 +0000399 tl_assert(p->mutex_type == mutex_type);
sewardjaf44c822007-11-25 14:01:38 +0000400 tl_assert(p->owner != DRD_INVALID_THREADID);
bart5357fcb2008-02-27 15:46:00 +0000401#if 0
sewardj721ad7b2007-11-30 08:30:29 +0000402 tl_assert(mutex_type == mutex_type_mutex
403 || mutex_type == mutex_type_spinlock);
bart5357fcb2008-02-27 15:46:00 +0000404#endif
sewardj721ad7b2007-11-30 08:30:29 +0000405
sewardjaf44c822007-11-25 14:01:38 +0000406 if (p->owner != drd_tid)
407 {
408 MutexErrInfo MEI = { p->mutex, p->recursion_count, p->owner };
409 VG_(maybe_record_error)(vg_tid,
410 MutexErr,
411 VG_(get_IP)(vg_tid),
412 "Mutex not unlocked by owner thread",
413 &MEI);
414 }
415 p->recursion_count--;
sewardj347eeba2008-01-21 14:19:07 +0000416 if (p->recursion_count < 0)
417 {
418 MutexErrInfo MEI
419 = { p->mutex, p->recursion_count, p->owner };
420 VG_(maybe_record_error)(vg_tid,
421 MutexErr,
422 VG_(get_IP)(vg_tid),
423 "Attempt to unlock a mutex that is not locked",
424 &MEI);
425 p->recursion_count = 0;
426 }
427
sewardjaf44c822007-11-25 14:01:38 +0000428 if (p->recursion_count == 0)
429 {
430 /* This pthread_mutex_unlock() call really unlocks the mutex. Save the */
431 /* current vector clock of the thread such that it is available when */
432 /* this mutex is locked again. */
bart301c3112008-02-24 18:22:37 +0000433 vc_assign(&p->vc, vc);
sewardjaf44c822007-11-25 14:01:38 +0000434
435 thread_new_segment(drd_tid);
436 }
437 return p->recursion_count;
438}
439
440const char* mutex_get_typename(struct mutex_info* const p)
441{
442 tl_assert(p);
sewardj721ad7b2007-11-30 08:30:29 +0000443
sewardj347eeba2008-01-21 14:19:07 +0000444 return mutex_type_name(p->mutex_type);
445}
446
447const char* mutex_type_name(const MutexT mt)
448{
449 switch (mt)
sewardjaf44c822007-11-25 14:01:38 +0000450 {
bart5357fcb2008-02-27 15:46:00 +0000451 case mutex_type_recursive_mutex:
452 return "recursive mutex";
453 case mutex_type_errorcheck_mutex:
454 return "error checking mutex";
455 case mutex_type_default_mutex:
sewardjaf44c822007-11-25 14:01:38 +0000456 return "mutex";
sewardj721ad7b2007-11-30 08:30:29 +0000457 case mutex_type_spinlock:
sewardjaf44c822007-11-25 14:01:38 +0000458 return "spinlock";
459 default:
460 tl_assert(0);
461 }
462 return "?";
463}
464
bart5357fcb2008-02-27 15:46:00 +0000465/** Return true if the specified mutex is locked by any thread. */
466static Bool mutex_is_locked(struct mutex_info* const p)
467{
468 tl_assert(p);
469 return (p->recursion_count > 0);
470}
471
sewardjaf44c822007-11-25 14:01:38 +0000472Bool mutex_is_locked_by(const Addr mutex, const DrdThreadId tid)
473{
474 struct mutex_info* const p = mutex_get(mutex);
sewardjaf44c822007-11-25 14:01:38 +0000475 if (p)
476 {
477 return (p->recursion_count > 0 && p->owner == tid);
478 }
479 return False;
480}
481
482const VectorClock* mutex_get_last_vc(const Addr mutex)
483{
484 struct mutex_info* const p = mutex_get(mutex);
485 return p ? &p->vc : 0;
486}
487
488int mutex_get_recursion_count(const Addr mutex)
489{
490 struct mutex_info* const p = mutex_get(mutex);
491 tl_assert(p);
492 return p->recursion_count;
493}
494
495/**
bart301c3112008-02-24 18:22:37 +0000496 * Call this function when thread tid stops to exist, such that the
sewardjaf44c822007-11-25 14:01:38 +0000497 * "last owner" field can be cleared if it still refers to that thread.
sewardjaf44c822007-11-25 14:01:38 +0000498 */
bart301c3112008-02-24 18:22:37 +0000499void mutex_thread_delete(const DrdThreadId tid)
sewardjaf44c822007-11-25 14:01:38 +0000500{
501 int i;
502 for (i = 0; i < sizeof(s_mutex)/sizeof(s_mutex[0]); i++)
503 {
504 struct mutex_info* const p = &s_mutex[i];
bart5357fcb2008-02-27 15:46:00 +0000505 if (p->mutex && p->owner == tid && p->recursion_count > 0)
sewardjaf44c822007-11-25 14:01:38 +0000506 {
bart5357fcb2008-02-27 15:46:00 +0000507 MutexErrInfo MEI
508 = { p->mutex, p->recursion_count, p->owner };
509 VG_(maybe_record_error)(VG_(get_running_tid)(),
510 MutexErr,
511 VG_(get_IP)(VG_(get_running_tid)()),
512 "Mutex still locked at thread exit",
513 &MEI);
sewardjaf44c822007-11-25 14:01:38 +0000514 p->owner = VG_INVALID_THREADID;
515 }
516 }
517}
518
519void mutex_stop_using_mem(const Addr a1, const Addr a2)
520{
521 unsigned i;
522 for (i = 0; i < sizeof(s_mutex)/sizeof(s_mutex[0]); i++)
523 {
524 if (a1 <= s_mutex[i].mutex && s_mutex[i].mutex < a2)
525 {
526 tl_assert(s_mutex[i].mutex + s_mutex[i].size <= a2);
527 mutex_destroy(&s_mutex[i]);
528 }
529 }
530}
531
532ULong get_mutex_lock_count(void)
533{
534 return s_mutex_lock_count;
535}
sewardj347eeba2008-01-21 14:19:07 +0000536
537
538/*
539 * Local variables:
540 * c-basic-offset: 3
541 * End:
542 */