4 * Copyright 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
8 * Woojin Jung <woojin2.jung@samsung.com>
9 * Jaewon Lim <jaewon81.lim@samsung.com>
10 * Juyoung Kim <j0.kim@samsung.com>
12 * This library is free software; you can redistribute it and/or modify it under
13 * the terms of the GNU Lesser General Public License as published by the
14 * Free Software Foundation; either version 2.1 of the License, or (at your option)
17 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
18 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20 * License for more details.
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this library; if not, write to the Free Software Foundation, Inc., 51
24 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 #include "probeinfo.h"
41 static enum DaOptions _sopt = OPT_THREAD;
43 int pthread_mutex_init(pthread_mutex_t *mutex,
44 const pthread_mutexattr_t *attr) {
45 static int (*pthread_mutex_initp)(pthread_mutex_t *mutex,
46 const pthread_mutexattr_t *attr);
48 BEFORE_ORIGINAL_SYNC(pthread_mutex_init, LIBPTHREAD);
50 ret = pthread_mutex_initp(mutex, attr);
52 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, mutex, SYNC_PTHREAD_MUTEX,
53 SYNC_API_OTHER, "%p,%p", mutex, attr);
55 AFTER_PACK_ORIGINAL_SYNC(ret, mutex, SYNC_PTHREAD_MUTEX,
56 SYNC_API_OTHER, "pp", mutex, attr);
61 int pthread_mutex_destroy(pthread_mutex_t *mutex) {
62 static int (*pthread_mutex_destroyp)(pthread_mutex_t *mutex);
64 BEFORE_ORIGINAL_SYNC(pthread_mutex_destroy, LIBPTHREAD);
66 ret = pthread_mutex_destroyp(mutex);
68 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, mutex, SYNC_PTHREAD_MUTEX,
69 SYNC_API_OTHER, "%p", mutex);
71 AFTER_PACK_ORIGINAL_SYNC(ret, mutex, SYNC_PTHREAD_MUTEX,
72 SYNC_API_OTHER, "p", mutex);
77 int real_pthread_mutex_lock(pthread_mutex_t *mutex) {
78 static int (*pthread_mutex_lockp)(pthread_mutex_t *mutex);
80 GET_REAL_FUNC(pthread_mutex_lock, LIBPTHREAD);
82 return pthread_mutex_lockp(mutex);
85 int pthread_mutex_lock(pthread_mutex_t *mutex) {
86 static int (*pthread_mutex_lockp)(pthread_mutex_t *mutex);
88 DECLARE_VARIABLE_STANDARD; log_t log;
89 GET_REAL_FUNC(pthread_mutex_lock, LIBPTHREAD);
91 PRE_PROBEBLOCK_BEGIN();
92 // send WAIT_START log
94 APPEND_LOG_BASIC(LC_SYNC);
95 APPEND_LOG_INPUT("%p", mutex);
96 //ret,PCAddr,errno,InternalCall
97 log.length += sprintf(log.data + log.length, "`,`,0`,0`,%d", blockresult);
99 log.length += sprintf(log.data + log.length, "`,%p`,%d`,%d", mutex,
100 SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_START);
101 APPEND_LOG_NULL_CALLSTACK();
102 printLog(&log, MSG_LOG);
105 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "p", mutex);
106 PACK_COMMON_END(0, 0, blockresult);
107 PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_START);
110 PRE_PROBEBLOCK_END();
112 ret = pthread_mutex_lockp(mutex);
116 if(postBlockBegin(blockresult)) {
117 setProbePoint(&probeInfo);
119 APPEND_LOG_BASIC(LC_SYNC);
120 APPEND_LOG_INPUT("%p", mutex);
121 APPEND_LOG_RESULT(VT_INT, ret);
124 POST_PROBEBLOCK_MIDDLE_SYNCVAL(mutex, SYNC_PTHREAD_MUTEX,
125 SYNC_API_ACQUIRE_WAIT_END);
126 POST_PROBEBLOCK_CALLSTACK();
127 printLog(&log, MSG_LOG);
130 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "p", mutex);
131 PACK_COMMON_END(ret, errno, blockresult);
132 PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_END);
141 int pthread_mutex_timedlock(pthread_mutex_t *mutex,
142 const struct timespec *abs_timeout) {
143 static int (*pthread_mutex_timedlockp)(pthread_mutex_t *mutex,
144 const struct timespec *abs_timeout);
146 DECLARE_VARIABLE_STANDARD; log_t log;
147 GET_REAL_FUNC(pthread_mutex_timedlock, LIBPTHREAD);
149 PRE_PROBEBLOCK_BEGIN();
150 // send WAIT_START log
152 APPEND_LOG_BASIC(LC_SYNC);
153 APPEND_LOG_INPUT("%p,%p", mutex, abs_timeout);
154 //ret,PCAddr,errno,InternalCall
155 log.length += sprintf(log.data + log.length, "`,`,0`,0`,%d", blockresult);
157 log.length += sprintf(log.data + log.length, "`,%p`,%d`,%d", mutex,
158 SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_START);
159 APPEND_LOG_NULL_CALLSTACK();
160 printLog(&log, MSG_LOG);
163 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "pp", mutex, abs_timeout);
164 PACK_COMMON_END(0, 0, blockresult);
165 PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_START);
168 PRE_PROBEBLOCK_END();
170 ret = pthread_mutex_timedlockp(mutex, abs_timeout);
174 if(postBlockBegin(blockresult)) {
175 setProbePoint(&probeInfo);
177 APPEND_LOG_BASIC(LC_SYNC);
178 APPEND_LOG_INPUT("%p,%p", mutex, abs_timeout);
179 APPEND_LOG_RESULT(VT_INT, ret);
182 POST_PROBEBLOCK_MIDDLE_SYNCVAL(mutex, SYNC_PTHREAD_MUTEX,
183 SYNC_API_ACQUIRE_WAIT_END);
184 POST_PROBEBLOCK_CALLSTACK();
185 printLog(&log, MSG_LOG);
188 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "pp", mutex, abs_timeout);
189 PACK_COMMON_END(ret, errno, blockresult);
190 PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_END);
199 int pthread_mutex_trylock(pthread_mutex_t *mutex) {
200 static int (*pthread_mutex_trylockp)(pthread_mutex_t *mutex);
202 BEFORE_ORIGINAL_SYNC(pthread_mutex_trylock, LIBPTHREAD);
204 ret = pthread_mutex_trylockp(mutex);
206 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, mutex, SYNC_PTHREAD_MUTEX,
207 SYNC_API_TRY_ACQUIRE, "%p", mutex);
209 AFTER_PACK_ORIGINAL_SYNC(ret, mutex, SYNC_PTHREAD_MUTEX,
210 SYNC_API_TRY_ACQUIRE, "p", mutex);
215 int real_pthread_mutex_unlock(pthread_mutex_t *mutex) {
216 static int (*pthread_mutex_unlockp)(pthread_mutex_t *mutex);
218 GET_REAL_FUNC(pthread_mutex_unlock, LIBPTHREAD);
220 return pthread_mutex_unlockp(mutex);
223 int pthread_mutex_unlock(pthread_mutex_t *mutex) {
224 static int (*pthread_mutex_unlockp)(pthread_mutex_t *mutex);
226 BEFORE_ORIGINAL_SYNC(pthread_mutex_unlock, LIBPTHREAD);
228 ret = pthread_mutex_unlockp(mutex);
230 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, mutex, SYNC_PTHREAD_MUTEX,
231 SYNC_API_RELEASE, "%p", mutex);
233 AFTER_PACK_ORIGINAL_SYNC(ret, mutex, SYNC_PTHREAD_MUTEX,
234 SYNC_API_RELEASE, "p", mutex);
239 int pthread_mutexattr_init(pthread_mutexattr_t *attr) {
240 static int (*pthread_mutexattr_initp)(pthread_mutexattr_t *attr);
242 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_init, LIBPTHREAD);
244 ret = pthread_mutexattr_initp(attr);
246 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
247 SYNC_API_OTHER, "%p", attr);
249 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
250 SYNC_API_OTHER, "p", attr);
255 int pthread_mutexattr_destroy(pthread_mutexattr_t *attr) {
256 static int (*pthread_mutexattr_destroyp)(pthread_mutexattr_t *attr);
258 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_destroy, LIBPTHREAD);
260 ret = pthread_mutexattr_destroyp(attr);
262 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
263 SYNC_API_OTHER, "%p", attr);
265 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
266 SYNC_API_OTHER, "p", attr);
271 int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr,
273 static int (*pthread_mutexattr_getprioceilingp)(
274 const pthread_mutexattr_t *attr, int *prioceiling);
276 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_getprioceiling, LIBPTHREAD);
278 ret = pthread_mutexattr_getprioceilingp(attr, prioceiling);
280 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
281 SYNC_API_OTHER, "%p,%p", attr, prioceiling);
283 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
284 SYNC_API_OTHER, "pp", attr, prioceiling);
289 int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr,
291 static int (*pthread_mutexattr_setprioceilingp)(
292 pthread_mutexattr_t *attr, int prioceiling);
294 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_setprioceiling, LIBPTHREAD);
296 ret = pthread_mutexattr_setprioceilingp(attr, prioceiling);
298 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
299 SYNC_API_OTHER, "%p,%d", attr, prioceiling);
301 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
302 SYNC_API_OTHER, "pd", attr, prioceiling);
307 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
309 static int (*pthread_mutexattr_getprotocolp)(
310 const pthread_mutexattr_t *attr, int *protocol);
312 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_getprotocol, LIBPTHREAD);
314 ret = pthread_mutexattr_getprotocolp(attr, protocol);
316 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
317 SYNC_API_OTHER, "%p,%p", attr, protocol);
319 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
320 SYNC_API_OTHER, "pp", attr, protocol);
325 int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
327 static int (*pthread_mutexattr_setprotocolp)(
328 pthread_mutexattr_t *attr, int protocol);
330 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_setprotocol, LIBPTHREAD);
332 ret = pthread_mutexattr_setprotocolp(attr, protocol);
334 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
335 SYNC_API_OTHER, "%p,%d", attr, protocol);
337 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
338 SYNC_API_OTHER, "pd", attr, protocol);
343 int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
345 static int (*pthread_mutexattr_getpsharedp)(
346 const pthread_mutexattr_t *attr, int *pshared);
348 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_getpshared, LIBPTHREAD);
350 ret = pthread_mutexattr_getpsharedp(attr, pshared);
352 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
353 SYNC_API_OTHER, "%p,%p", attr, pshared);
355 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
356 SYNC_API_OTHER, "pp", attr, pshared);
361 int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr,
363 static int (*pthread_mutexattr_setpsharedp)(
364 pthread_mutexattr_t *attr, int pshared);
366 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_setpshared, LIBPTHREAD);
368 ret = pthread_mutexattr_setpsharedp(attr, pshared);
370 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
371 SYNC_API_OTHER, "%p,%d", attr, pshared);
373 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
374 SYNC_API_OTHER, "pd", attr, pshared);
379 int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type) {
380 static int (*pthread_mutexattr_gettypep)(
381 const pthread_mutexattr_t *attr, int *type);
383 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_gettype, LIBPTHREAD);
385 ret = pthread_mutexattr_gettypep(attr, type);
387 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
388 SYNC_API_OTHER, "%p,%p", attr, type);
390 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
391 SYNC_API_OTHER, "pp", attr, type);
396 int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) {
397 static int (*pthread_mutexattr_settypep)(
398 pthread_mutexattr_t *attr, int type);
400 BEFORE_ORIGINAL_SYNC(pthread_mutexattr_settype, LIBPTHREAD);
402 ret = pthread_mutexattr_settypep(attr, type);
404 AFTER_ORIGINAL_NOSYNCVAL_RET(VT_INT, ret, SYNC_PTHREAD_MUTEX,
405 SYNC_API_OTHER, "%p,%d", attr, type);
407 AFTER_PACK_ORIGINAL_SYNC(ret, 0, SYNC_PTHREAD_MUTEX,
408 SYNC_API_OTHER, "pd", attr, type);
414 int pthread_mutex_getprioceiling(const pthread_mutex_t *mutex,
416 int pthread_mutex_setprioceiling(pthread_mutex_t *mutex,
417 int prioceiling, int *old_ceiling);
420 int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) {
421 static int (*pthread_cond_initp)(pthread_cond_t *cond,
422 const pthread_condattr_t *attr);
424 BEFORE_ORIGINAL_SYNC(pthread_cond_init, LIBPTHREAD);
426 ret = pthread_cond_initp(cond, attr);
428 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, cond, SYNC_PTHREAD_COND_VARIABLE,
429 SYNC_API_OTHER, "%p,%p", cond, attr);
431 AFTER_PACK_ORIGINAL_SYNC(ret, cond, SYNC_PTHREAD_COND_VARIABLE,
432 SYNC_API_OTHER, "pp", cond, attr);
437 int pthread_cond_destroy(pthread_cond_t *cond) {
438 static int (*pthread_cond_destroyp)(pthread_cond_t *cond);
440 BEFORE_ORIGINAL_SYNC(pthread_cond_destroy, LIBPTHREAD);
442 ret = pthread_cond_destroyp(cond);
444 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, cond, SYNC_PTHREAD_COND_VARIABLE,
445 SYNC_API_OTHER, "%p", cond);
447 AFTER_PACK_ORIGINAL_SYNC(ret, cond, SYNC_PTHREAD_COND_VARIABLE,
448 SYNC_API_OTHER, "p", cond);
453 int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
454 static int (*pthread_cond_waitp)(pthread_cond_t *cond,
455 pthread_mutex_t *mutex);
457 DECLARE_VARIABLE_STANDARD; log_t log;
458 GET_REAL_FUNC(pthread_cond_wait, LIBPTHREAD);
460 PRE_PROBEBLOCK_BEGIN();
461 // send WAIT_START log
463 APPEND_LOG_BASIC(LC_SYNC);
464 APPEND_LOG_INPUT("%p,%p", cond, mutex);
465 //ret,PCAddr,errno,InternalCall
466 log.length += sprintf(log.data + log.length, "`,`,0`,0`,%d", blockresult);
468 log.length += sprintf(log.data + log.length, "`,%p`,%d`,%d", cond,
469 SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_START);
470 APPEND_LOG_NULL_CALLSTACK();
471 printLog(&log, MSG_LOG);
474 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "pp", cond, mutex);
475 PACK_COMMON_END(0, 0, blockresult);
476 PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_START);
479 PRE_PROBEBLOCK_END();
481 ret = pthread_cond_waitp(cond, mutex);
485 if(postBlockBegin(blockresult)) {
486 setProbePoint(&probeInfo);
488 APPEND_LOG_BASIC(LC_SYNC);
489 APPEND_LOG_INPUT("%p,%p", cond, mutex);
490 APPEND_LOG_RESULT(VT_INT, ret);
493 POST_PROBEBLOCK_MIDDLE_SYNCVAL(cond, SYNC_PTHREAD_COND_VARIABLE,
494 SYNC_API_COND_WAIT_END);
495 POST_PROBEBLOCK_CALLSTACK();
496 printLog(&log, MSG_LOG);
499 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "pp", cond, mutex);
500 PACK_COMMON_END(ret, errno, blockresult);
501 PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_END);
510 int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
511 const struct timespec *abstime) {
512 static int (*pthread_cond_timedwaitp)(pthread_cond_t *cond,
513 pthread_mutex_t *mutex, const struct timespec *abstime);
515 DECLARE_VARIABLE_STANDARD; log_t log;
516 GET_REAL_FUNC(pthread_cond_timedwait, LIBPTHREAD);
518 PRE_PROBEBLOCK_BEGIN();
519 // send WAIT_START log
521 APPEND_LOG_BASIC(LC_SYNC);
522 APPEND_LOG_INPUT("%p,%p,%p", cond, mutex, abstime);
523 //ret,PCAddr,errno,InternalCall
524 log.length += sprintf(log.data + log.length, "`,`,0`,0`,%d", blockresult);
526 log.length += sprintf(log.data + log.length, "`,%p`,%d`,%d", cond,
527 SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_START);
528 APPEND_LOG_NULL_CALLSTACK();
529 printLog(&log, MSG_LOG);
532 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "ppp", cond, mutex, abstime);
533 PACK_COMMON_END(0, 0, blockresult);
534 PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_START);
537 PRE_PROBEBLOCK_END();
539 ret = pthread_cond_timedwaitp(cond, mutex, abstime);
543 if(postBlockBegin(blockresult)) {
544 setProbePoint(&probeInfo);
546 APPEND_LOG_BASIC(LC_SYNC);
547 APPEND_LOG_INPUT("%p,%p,%p", cond, mutex, abstime);
548 APPEND_LOG_RESULT(VT_INT, ret);
551 POST_PROBEBLOCK_MIDDLE_SYNCVAL(cond, SYNC_PTHREAD_COND_VARIABLE,
552 SYNC_API_COND_WAIT_END);
553 POST_PROBEBLOCK_CALLSTACK();
554 printLog(&log, MSG_LOG);
557 PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "ppp", cond, mutex, abstime);
558 PACK_COMMON_END(ret, errno, blockresult);
559 PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_END);
568 int pthread_cond_signal(pthread_cond_t *cond) {
569 static int (*pthread_cond_signalp)(pthread_cond_t *cond);
571 BEFORE_ORIGINAL_SYNC(pthread_cond_signal, LIBPTHREAD);
573 ret = pthread_cond_signalp(cond);
575 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, cond, SYNC_PTHREAD_COND_VARIABLE,
576 SYNC_API_NOTIFY, "%p", cond);
578 AFTER_PACK_ORIGINAL_SYNC(ret, cond, SYNC_PTHREAD_COND_VARIABLE,
579 SYNC_API_NOTIFY, "p", cond);
584 int pthread_cond_broadcast(pthread_cond_t *cond) {
585 static int (*pthread_cond_broadcastp)(pthread_cond_t *cond);
587 BEFORE_ORIGINAL_SYNC(pthread_cond_broadcast, LIBPTHREAD);
589 ret = pthread_cond_broadcastp(cond);
591 AFTER_ORIGINAL_SYNCVAL_RET(VT_INT, ret, cond, SYNC_PTHREAD_COND_VARIABLE,
592 SYNC_API_NOTIFY_ALL, "%p", cond);
594 AFTER_PACK_ORIGINAL_SYNC(ret, cond, SYNC_PTHREAD_COND_VARIABLE,
595 SYNC_API_NOTIFY_ALL, "p", cond);
601 int pthread_condattr_init(pthread_condattr_t *attr);
602 int pthread_condattr_destroy(pthread_condattr_t *attr);
603 int pthread_condattr_getclock(const pthread_condattr_t *attr,
604 clockid_t *clock_id);
605 int pthread_condattr_setclock(pthread_condattr_t *attr,
607 int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
608 int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);
612 int pthread_rwlock_init(pthread_rwlock_t *rwlock,
613 const pthread_rwlockattr_t *attr);
614 int pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
615 int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
616 int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
617 int pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock,
618 const struct timespec *abs_timeout);
619 int pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock,
620 const struct timespec *abs_timeout);
621 int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock);
622 int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock);
623 int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
624 int pthread_rwlockattr_init(pthread_rwlockattr_t *attr);
625 int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);
626 int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *attr,
628 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr,
631 int pthread_spin_init(pthread_spinlock_t *lock, int pshared);
632 int pthread_spin_destroy(pthread_spinlock_t *lock);
633 int pthread_spin_lock(pthread_spinlock_t *lock);
634 int pthread_spin_trylock(pthread_spinlock_t *lock);
635 int pthread_spin_unlock(pthread_spinlock_t *lock);
637 int pthread_barrier_init(pthread_barrier_t *barrier,
638 const pthread_barrierattr_t *attr, unsigned int count);
639 int pthread_barrier_destroy(pthread_barrier_t *barrier);
640 int pthread_barrier_wait(pthread_barrier_t *barrier);
641 int pthread_barrierattr_init(pthread_barrierattr_t *attr);
642 int pthread_barrierattr_destroy(pthread_barrierattr_t *attr);
643 int pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr,
645 int pthread_barrierattr_setpshared(pthread_barrierattr_t,