blob: f2e38e2f4f6762fac64589f20e4e39c6fd4a0273 [file] [log] [blame]
bartbedfd232009-03-26 19:07:15 +00001/* -*- mode: C; c-basic-offset: 3; -*- */
sewardj85642922008-01-14 11:54:56 +00002/*
bart86562bd2009-02-16 19:43:56 +00003 This file is part of drd, a thread error detector.
sewardj85642922008-01-14 11:54:56 +00004
bart86562bd2009-02-16 19:43:56 +00005 Copyright (C) 2006-2009 Bart Van Assche <bart.vanassche@gmail.com>.
sewardj85642922008-01-14 11:54:56 +00006
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
bart28230a32008-02-29 17:27:03 +000026#include "drd_clientobj.h"
sewardj85642922008-01-14 11:54:56 +000027#include "drd_error.h"
28#include "drd_semaphore.h"
29#include "drd_suppression.h"
sewardj85642922008-01-14 11:54:56 +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)()
bart3e017fa2008-12-17 19:20:13 +000034#include "pub_tool_mallocfree.h" // VG_(malloc), VG_(free)
sewardj85642922008-01-14 11:54:56 +000035#include "pub_tool_threadstate.h" // VG_(get_running_tid)()
36
37
bartdc1ef032009-02-15 14:18:02 +000038/* Local functions. */
sewardj85642922008-01-14 11:54:56 +000039
bartd2c5eae2009-02-21 15:27:04 +000040static void semaphore_cleanup(struct semaphore_info* p);
sewardj85642922008-01-14 11:54:56 +000041
42
bartdc1ef032009-02-15 14:18:02 +000043/* Local variables. */
sewardj85642922008-01-14 11:54:56 +000044
bartd2c5eae2009-02-21 15:27:04 +000045static Bool s_trace_semaphore;
46static ULong s_semaphore_segment_creation_count;
sewardj85642922008-01-14 11:54:56 +000047
48
bartdc1ef032009-02-15 14:18:02 +000049/* Function definitions. */
sewardj85642922008-01-14 11:54:56 +000050
bartdc1ef032009-02-15 14:18:02 +000051/** Push a segment at the end of the queue 'p->last_sem_post_seg'. */
bart25f9f542009-07-23 16:31:39 +000052static void drd_segment_push(struct semaphore_info* p, Segment* sg)
bart3e017fa2008-12-17 19:20:13 +000053{
bartbedfd232009-03-26 19:07:15 +000054 Word n;
bart3e017fa2008-12-17 19:20:13 +000055
bartbedfd232009-03-26 19:07:15 +000056 tl_assert(sg);
57 n = VG_(addToXA)(p->last_sem_post_seg, &sg);
bart3e017fa2008-12-17 19:20:13 +000058#if 0
bartbedfd232009-03-26 19:07:15 +000059 VG_(message)(Vg_UserMsg, "0x%lx push: added at position %ld/%ld",
60 p->a1, n, VG_(sizeXA)(p->last_sem_post_seg));
bart3e017fa2008-12-17 19:20:13 +000061#endif
bartbedfd232009-03-26 19:07:15 +000062 tl_assert(*(Segment**)VG_(indexXA)(p->last_sem_post_seg, n) == sg);
bart3e017fa2008-12-17 19:20:13 +000063}
64
bartdc1ef032009-02-15 14:18:02 +000065/** Pop a segment from the beginning of the queue 'p->last_sem_post_seg'. */
bart25f9f542009-07-23 16:31:39 +000066static Segment* drd_segment_pop(struct semaphore_info* p)
bart3e017fa2008-12-17 19:20:13 +000067{
bartbedfd232009-03-26 19:07:15 +000068 Word sz;
69 Segment* sg;
bart3e017fa2008-12-17 19:20:13 +000070
bartbedfd232009-03-26 19:07:15 +000071 sz = VG_(sizeXA)(p->last_sem_post_seg);
bart3e017fa2008-12-17 19:20:13 +000072#if 0
bartbedfd232009-03-26 19:07:15 +000073 VG_(message)(Vg_UserMsg, "0x%lx pop: removed from position %ld/%ld",
74 p->a1, sz - 1, sz);
bart3e017fa2008-12-17 19:20:13 +000075#endif
bartbedfd232009-03-26 19:07:15 +000076 sg = 0;
77 if (sz > 0)
78 {
79 sg = *(Segment**)VG_(indexXA)(p->last_sem_post_seg, sz - 1);
80 tl_assert(sg);
81 VG_(dropTailXA)(p->last_sem_post_seg, 1);
82 }
83 return sg;
bart3e017fa2008-12-17 19:20:13 +000084}
85
bartdc1ef032009-02-15 14:18:02 +000086/** Enable or disable tracing of semaphore actions. */
87void DRD_(semaphore_set_trace)(const Bool trace_semaphore)
sewardj85642922008-01-14 11:54:56 +000088{
bartbedfd232009-03-26 19:07:15 +000089 s_trace_semaphore = trace_semaphore;
sewardj85642922008-01-14 11:54:56 +000090}
91
bartdc1ef032009-02-15 14:18:02 +000092/**
93 * Initialize the memory 'p' points at as a semaphore_info structure for the
94 * client semaphore at client addres 'semaphore'.
95 */
sewardj85642922008-01-14 11:54:56 +000096static
bart25f9f542009-07-23 16:31:39 +000097void drd_semaphore_initialize(struct semaphore_info* const p,
98 const Addr semaphore)
sewardj85642922008-01-14 11:54:56 +000099{
bartbedfd232009-03-26 19:07:15 +0000100 tl_assert(semaphore != 0);
101 tl_assert(p->a1 == semaphore);
102 tl_assert(p->type == ClientSemaphore);
sewardj85642922008-01-14 11:54:56 +0000103
bartbedfd232009-03-26 19:07:15 +0000104 p->cleanup = (void(*)(DrdClientobj*))semaphore_cleanup;
105 p->delete_thread = 0;
106 p->waits_to_skip = 0;
107 p->value = 0;
108 p->waiters = 0;
109 p->last_sem_post_tid = DRD_INVALID_THREADID;
110 p->last_sem_post_seg = VG_(newXA)(VG_(malloc), "drd.sg-stack",
111 VG_(free), sizeof(Segment*));
sewardj85642922008-01-14 11:54:56 +0000112}
113
bart195e41f2009-02-15 11:34:57 +0000114/**
115 * Free the memory that was allocated by semaphore_initialize(). Called by
116 * DRD_(clientobj_remove)().
bart28230a32008-02-29 17:27:03 +0000117 */
bartd2c5eae2009-02-21 15:27:04 +0000118static void semaphore_cleanup(struct semaphore_info* p)
bart28230a32008-02-29 17:27:03 +0000119{
bartbedfd232009-03-26 19:07:15 +0000120 Segment* sg;
bart3e017fa2008-12-17 19:20:13 +0000121
bartbedfd232009-03-26 19:07:15 +0000122 if (p->waiters > 0)
123 {
bartd45d9952009-05-31 18:53:54 +0000124 SemaphoreErrInfo sei = { DRD_(thread_get_running_tid)(), p->a1 };
bartbedfd232009-03-26 19:07:15 +0000125 VG_(maybe_record_error)(VG_(get_running_tid)(),
126 SemaphoreErr,
127 VG_(get_IP)(VG_(get_running_tid)()),
128 "Destruction of semaphore that is being waited"
129 " upon",
130 &sei);
131 }
bart25f9f542009-07-23 16:31:39 +0000132 while ((sg = drd_segment_pop(p)))
bartbedfd232009-03-26 19:07:15 +0000133 DRD_(sg_put)(sg);
134 VG_(deleteXA)(p->last_sem_post_seg);
bart28230a32008-02-29 17:27:03 +0000135}
136
bartdc1ef032009-02-15 14:18:02 +0000137/**
138 * Return a pointer to the structure with information about the specified
139 * client semaphore. Allocate a new structure if such a structure did not
140 * yet exist.
141 */
sewardj85642922008-01-14 11:54:56 +0000142static
143struct semaphore_info*
bart25f9f542009-07-23 16:31:39 +0000144drd_semaphore_get_or_allocate(const Addr semaphore)
sewardj85642922008-01-14 11:54:56 +0000145{
bartbedfd232009-03-26 19:07:15 +0000146 struct semaphore_info *p;
sewardj85642922008-01-14 11:54:56 +0000147
bartbedfd232009-03-26 19:07:15 +0000148 tl_assert(offsetof(DrdClientobj, semaphore) == 0);
149 p = &(DRD_(clientobj_get)(semaphore, ClientSemaphore)->semaphore);
150 if (p == 0)
151 {
152 tl_assert(offsetof(DrdClientobj, semaphore) == 0);
153 p = &(DRD_(clientobj_add)(semaphore, ClientSemaphore)->semaphore);
bart25f9f542009-07-23 16:31:39 +0000154 drd_semaphore_initialize(p, semaphore);
bartbedfd232009-03-26 19:07:15 +0000155 }
156 return p;
sewardj85642922008-01-14 11:54:56 +0000157}
158
bartdc1ef032009-02-15 14:18:02 +0000159/**
160 * Return a pointer to the structure with information about the specified
161 * client semaphore, or null if no such structure was found.
162 */
bartd45d9952009-05-31 18:53:54 +0000163static struct semaphore_info* semaphore_get(const Addr semaphore)
bart28230a32008-02-29 17:27:03 +0000164{
bartbedfd232009-03-26 19:07:15 +0000165 tl_assert(offsetof(DrdClientobj, semaphore) == 0);
166 return &(DRD_(clientobj_get)(semaphore, ClientSemaphore)->semaphore);
bart28230a32008-02-29 17:27:03 +0000167}
168
169/** Called before sem_init(). */
bartdc1ef032009-02-15 14:18:02 +0000170struct semaphore_info* DRD_(semaphore_init)(const Addr semaphore,
171 const Word pshared,
172 const UInt value)
sewardj85642922008-01-14 11:54:56 +0000173{
bartbedfd232009-03-26 19:07:15 +0000174 struct semaphore_info* p;
175 Segment* sg;
sewardj85642922008-01-14 11:54:56 +0000176
bartbedfd232009-03-26 19:07:15 +0000177 if (s_trace_semaphore)
178 {
179 VG_(message)(Vg_UserMsg,
bart63c92ea2009-07-19 17:53:56 +0000180 "[%d] semaphore_init 0x%lx value %u\n",
bartbedfd232009-03-26 19:07:15 +0000181 DRD_(thread_get_running_tid)(),
182 semaphore,
183 value);
184 }
bartd45d9952009-05-31 18:53:54 +0000185 p = semaphore_get(semaphore);
bartbedfd232009-03-26 19:07:15 +0000186 if (p)
187 {
188 const ThreadId vg_tid = VG_(get_running_tid)();
bartd45d9952009-05-31 18:53:54 +0000189 SemaphoreErrInfo SEI = { DRD_(thread_get_running_tid)(), semaphore };
bartbedfd232009-03-26 19:07:15 +0000190 VG_(maybe_record_error)(vg_tid,
191 SemaphoreErr,
192 VG_(get_IP)(vg_tid),
193 "Semaphore reinitialization",
194 &SEI);
195 // Remove all segments from the segment stack.
bart25f9f542009-07-23 16:31:39 +0000196 while ((sg = drd_segment_pop(p)))
bartbedfd232009-03-26 19:07:15 +0000197 {
198 DRD_(sg_put)(sg);
199 }
200 }
201 else
202 {
bart25f9f542009-07-23 16:31:39 +0000203 p = drd_semaphore_get_or_allocate(semaphore);
bartbedfd232009-03-26 19:07:15 +0000204 }
205 tl_assert(p);
206 p->waits_to_skip = value;
207 p->value = value;
208 return p;
sewardj85642922008-01-14 11:54:56 +0000209}
210
bart28230a32008-02-29 17:27:03 +0000211/** Called after sem_destroy(). */
bartdc1ef032009-02-15 14:18:02 +0000212void DRD_(semaphore_destroy)(const Addr semaphore)
sewardj85642922008-01-14 11:54:56 +0000213{
bartbedfd232009-03-26 19:07:15 +0000214 struct semaphore_info* p;
bart3b1ee452008-02-29 19:28:15 +0000215
bartd45d9952009-05-31 18:53:54 +0000216 p = semaphore_get(semaphore);
bartda9436b2008-12-14 08:56:49 +0000217
bartbedfd232009-03-26 19:07:15 +0000218 if (s_trace_semaphore)
219 {
220 VG_(message)(Vg_UserMsg,
bart63c92ea2009-07-19 17:53:56 +0000221 "[%d] semaphore_destroy 0x%lx value %u\n",
bartbedfd232009-03-26 19:07:15 +0000222 DRD_(thread_get_running_tid)(),
223 semaphore,
224 p ? p->value : 0);
225 }
bart3b1ee452008-02-29 19:28:15 +0000226
bartbedfd232009-03-26 19:07:15 +0000227 if (p == 0)
228 {
bartd45d9952009-05-31 18:53:54 +0000229 GenericErrInfo GEI = { DRD_(thread_get_running_tid)() };
bartbedfd232009-03-26 19:07:15 +0000230 VG_(maybe_record_error)(VG_(get_running_tid)(),
231 GenericErr,
232 VG_(get_IP)(VG_(get_running_tid)()),
233 "Not a semaphore",
234 &GEI);
235 return;
236 }
bart72b751c2008-03-01 13:44:24 +0000237
bartbedfd232009-03-26 19:07:15 +0000238 DRD_(clientobj_remove)(semaphore, ClientSemaphore);
sewardj85642922008-01-14 11:54:56 +0000239}
240
bart25f9f542009-07-23 16:31:39 +0000241/** Called after sem_open(). */
242struct semaphore_info* DRD_(semaphore_open)(const Addr semaphore,
243 const Char* name, const Word oflag,
244 const Word mode, const UInt value)
245{
246 struct semaphore_info* p;
247 Segment* sg;
248
249 if (s_trace_semaphore)
250 {
251 VG_(message)(Vg_UserMsg,
252 "[%d] semaphore_open 0x%lx name %s"
253 " oflag %ld mode 0%lo value %u\n",
254 DRD_(thread_get_running_tid)(),
255 semaphore, name, oflag, mode, value);
256 }
257
258 /* Return if the sem_open() call failed. */
259 if (! semaphore)
260 return NULL;
261
262 p = semaphore_get(semaphore);
263 if (p)
264 {
265 const ThreadId vg_tid = VG_(get_running_tid)();
266 SemaphoreErrInfo SEI = { DRD_(thread_get_running_tid)(), semaphore };
267 VG_(maybe_record_error)(vg_tid,
268 SemaphoreErr,
269 VG_(get_IP)(vg_tid),
270 "Semaphore reinitialization",
271 &SEI);
272 // Remove all segments from the segment stack.
273 while ((sg = drd_segment_pop(p)))
274 {
275 DRD_(sg_put)(sg);
276 }
277 }
278 else
279 {
280 p = drd_semaphore_get_or_allocate(semaphore);
281 }
282 tl_assert(p);
283 p->waits_to_skip = value;
284 p->value = value;
285 return p;
286}
287
288/** Called before sem_close(). */
289void DRD_(semaphore_close)(const Addr semaphore)
290{
291 struct semaphore_info* p;
292
293 p = semaphore_get(semaphore);
294
295 if (s_trace_semaphore)
296 {
297 VG_(message)(Vg_UserMsg,
298 "[%d] semaphore_close 0x%lx value %u\n",
299 DRD_(thread_get_running_tid)(),
300 semaphore,
301 p ? p->value : 0);
302 }
303
304 if (p == 0)
305 {
306 GenericErrInfo GEI = { DRD_(thread_get_running_tid)() };
307 VG_(maybe_record_error)(VG_(get_running_tid)(),
308 GenericErr,
309 VG_(get_IP)(VG_(get_running_tid)()),
310 "Not a semaphore",
311 &GEI);
312 return;
313 }
314
315 DRD_(clientobj_remove)(semaphore, ClientSemaphore);
316}
317
bart28230a32008-02-29 17:27:03 +0000318/** Called before sem_wait(). */
bartdc1ef032009-02-15 14:18:02 +0000319void DRD_(semaphore_pre_wait)(const Addr semaphore)
sewardj85642922008-01-14 11:54:56 +0000320{
bartbedfd232009-03-26 19:07:15 +0000321 struct semaphore_info* p;
sewardj85642922008-01-14 11:54:56 +0000322
bart25f9f542009-07-23 16:31:39 +0000323 p = drd_semaphore_get_or_allocate(semaphore);
bartbedfd232009-03-26 19:07:15 +0000324 tl_assert(p);
bartbedfd232009-03-26 19:07:15 +0000325 p->waiters++;
bart3eecd9a2009-06-06 12:28:20 +0000326
bart9986c992009-07-23 07:11:27 +0000327 if ((Word)(p->waiters) <= 0)
bart3eecd9a2009-06-06 12:28:20 +0000328 {
329 SemaphoreErrInfo sei = { DRD_(thread_get_running_tid)(), semaphore };
330 VG_(maybe_record_error)(VG_(get_running_tid)(),
331 SemaphoreErr,
332 VG_(get_IP)(VG_(get_running_tid)()),
333 "Invalid semaphore",
334 &sei);
335 }
bart28230a32008-02-29 17:27:03 +0000336}
337
bartdc1ef032009-02-15 14:18:02 +0000338/**
339 * Called after sem_wait() finished.
340 * @note Do not rely on the value of 'waited' -- some glibc versions do
341 * not set it correctly.
bart28230a32008-02-29 17:27:03 +0000342 */
bartdc1ef032009-02-15 14:18:02 +0000343void DRD_(semaphore_post_wait)(const DrdThreadId tid, const Addr semaphore,
344 const Bool waited)
bart28230a32008-02-29 17:27:03 +0000345{
bartbedfd232009-03-26 19:07:15 +0000346 struct semaphore_info* p;
347 Segment* sg;
bart28230a32008-02-29 17:27:03 +0000348
bartd45d9952009-05-31 18:53:54 +0000349 p = semaphore_get(semaphore);
bartbedfd232009-03-26 19:07:15 +0000350 if (s_trace_semaphore)
351 {
352 VG_(message)(Vg_UserMsg,
bart63c92ea2009-07-19 17:53:56 +0000353 "[%d] semaphore_wait 0x%lx value %u -> %u\n",
bartbedfd232009-03-26 19:07:15 +0000354 DRD_(thread_get_running_tid)(),
355 semaphore,
356 p ? p->value : 0,
357 p ? p->value - 1 : 0);
358 }
bart57ae7ad2009-06-06 10:56:40 +0000359
360 if (p)
361 {
362 p->waiters--;
363 p->value--;
364 }
365
366 /*
367 * Note: if another thread destroyed and reinitialized a semaphore while
368 * the current thread was waiting in sem_wait, p->waiters may have been
bart25f9f542009-07-23 16:31:39 +0000369 * set to zero by drd_semaphore_initialize() after
bart57ae7ad2009-06-06 10:56:40 +0000370 * DRD_(semaphore_pre_wait)() has finished before
371 * DRD_(semaphore_post_wait)() has been called.
372 */
bart9986c992009-07-23 07:11:27 +0000373 if (p == NULL || (Int)(p->value) < 0 || (Word)(p->waiters) < 0)
bartbedfd232009-03-26 19:07:15 +0000374 {
bartd45d9952009-05-31 18:53:54 +0000375 SemaphoreErrInfo sei = { DRD_(thread_get_running_tid)(), semaphore };
bartbedfd232009-03-26 19:07:15 +0000376 VG_(maybe_record_error)(VG_(get_running_tid)(),
377 SemaphoreErr,
378 VG_(get_IP)(VG_(get_running_tid)()),
379 "Invalid semaphore",
380 &sei);
381 return;
382 }
bart57ae7ad2009-06-06 10:56:40 +0000383
bartbedfd232009-03-26 19:07:15 +0000384 if (p->waits_to_skip > 0)
385 p->waits_to_skip--;
386 else
387 {
bart25f9f542009-07-23 16:31:39 +0000388 sg = drd_segment_pop(p);
bartbedfd232009-03-26 19:07:15 +0000389 tl_assert(sg);
390 if (sg)
bart94866cc2008-12-21 17:20:22 +0000391 {
bartbedfd232009-03-26 19:07:15 +0000392 if (p->last_sem_post_tid != tid
393 && p->last_sem_post_tid != DRD_INVALID_THREADID)
394 {
bartf6ec1fe2009-06-21 18:07:35 +0000395 DRD_(thread_new_segment_and_combine_vc)(tid, sg);
bartbedfd232009-03-26 19:07:15 +0000396 }
bartf6ec1fe2009-06-21 18:07:35 +0000397 else
398 DRD_(thread_new_segment)(tid);
399 s_semaphore_segment_creation_count++;
bartbedfd232009-03-26 19:07:15 +0000400 DRD_(sg_put)(sg);
bart94866cc2008-12-21 17:20:22 +0000401 }
bartbedfd232009-03-26 19:07:15 +0000402 }
sewardj85642922008-01-14 11:54:56 +0000403}
404
405/** Called before sem_post(). */
bartdc1ef032009-02-15 14:18:02 +0000406void DRD_(semaphore_pre_post)(const DrdThreadId tid, const Addr semaphore)
sewardj85642922008-01-14 11:54:56 +0000407{
bartbedfd232009-03-26 19:07:15 +0000408 struct semaphore_info* p;
409 Segment* sg;
sewardj85642922008-01-14 11:54:56 +0000410
bart25f9f542009-07-23 16:31:39 +0000411 p = drd_semaphore_get_or_allocate(semaphore);
bartbedfd232009-03-26 19:07:15 +0000412 p->value++;
bartda9436b2008-12-14 08:56:49 +0000413
bartbedfd232009-03-26 19:07:15 +0000414 if (s_trace_semaphore)
415 {
416 VG_(message)(Vg_UserMsg,
bart63c92ea2009-07-19 17:53:56 +0000417 "[%d] semaphore_post 0x%lx value %u -> %u\n",
bartbedfd232009-03-26 19:07:15 +0000418 DRD_(thread_get_running_tid)(),
419 semaphore,
420 p->value - 1, p->value);
421 }
bartda9436b2008-12-14 08:56:49 +0000422
bartbedfd232009-03-26 19:07:15 +0000423 p->last_sem_post_tid = tid;
bartbedfd232009-03-26 19:07:15 +0000424 sg = 0;
425 DRD_(thread_get_latest_segment)(&sg, tid);
426 tl_assert(sg);
bart25f9f542009-07-23 16:31:39 +0000427 drd_segment_push(p, sg);
bartc02dde42009-06-06 09:28:28 +0000428 DRD_(thread_new_segment)(tid);
bartbedfd232009-03-26 19:07:15 +0000429 s_semaphore_segment_creation_count++;
sewardj85642922008-01-14 11:54:56 +0000430}
431
bartd45d9952009-05-31 18:53:54 +0000432/** Called after sem_post() finished. */
bartdc1ef032009-02-15 14:18:02 +0000433void DRD_(semaphore_post_post)(const DrdThreadId tid, const Addr semaphore,
bartd45d9952009-05-31 18:53:54 +0000434 const Bool succeeded)
sewardj85642922008-01-14 11:54:56 +0000435{
bartd45d9952009-05-31 18:53:54 +0000436 /*
437 * Note: it is hard to implement the sem_post() wrapper correctly in
438 * case sem_post() returns an error code. This is because handling this
439 * case correctly requires restoring the vector clock associated with
440 * the semaphore to its original value here. In order to do that without
441 * introducing a race condition, extra locking has to be added around
442 * each semaphore call. Such extra locking would have to be added in
443 * drd_pthread_intercepts.c. However, it is hard to implement
444 * synchronization in drd_pthread_intercepts.c in a portable way without
445 * calling already redirected functions.
446 */
sewardj85642922008-01-14 11:54:56 +0000447}
448
bartdc1ef032009-02-15 14:18:02 +0000449ULong DRD_(get_semaphore_segment_creation_count)(void)
bart6bbefaf2008-04-19 15:16:45 +0000450{
bartbedfd232009-03-26 19:07:15 +0000451 return s_semaphore_segment_creation_count;
bart6bbefaf2008-04-19 15:16:45 +0000452}