800
801
fprintf(stderr, "<< pthread_rwl_wlk %p", rwlock); fflush(stderr);
803
DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
804
pthread_rwlock_t*,rwlock, long,1/*isW*/);
804
DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
805
pthread_rwlock_t*,rwlock,
806
long,1/*isW*/, long,0/*!isTryLock*/);
806
808
CALL_FN_W_W(ret, fn, rwlock);
829
832
fprintf(stderr, "<< pthread_rwl_rlk %p", rwlock); fflush(stderr);
832
DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
833
pthread_rwlock_t*,rwlock, long,0/*!isW*/);
835
DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
836
pthread_rwlock_t*,rwlock,
837
long,0/*!isW*/, long,0/*!isTryLock*/);
835
839
CALL_FN_W_W(ret, fn, rwlock);
855
// pthread_rwlock_trywrlock
856
PTH_FUNC(int, pthreadZurwlockZutrywrlock, // pthread_rwlock_trywrlock
857
pthread_rwlock_t* rwlock)
861
VALGRIND_GET_ORIG_FN(fn);
863
fprintf(stderr, "<< pthread_rwl_trywlk %p", rwlock); fflush(stderr);
866
DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
867
pthread_rwlock_t*,rwlock,
868
long,1/*isW*/, long,1/*isTryLock*/);
870
CALL_FN_W_W(ret, fn, rwlock);
872
/* There's a hole here: libpthread now knows the lock is locked,
873
but the tool doesn't, so some other thread could run and detect
874
that the lock has been acquired by someone (this thread). Does
875
this matter? Not sure, but I don't think so. */
877
if (ret == 0 /*success*/) {
878
DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_POST,
879
pthread_rwlock_t*,rwlock, long,1/*isW*/);
882
DO_PthAPIerror( "pthread_rwlock_trywrlock", ret );
886
fprintf(stderr, " :: rwl_trywlk -> %d >>\n", ret);
892
// pthread_rwlock_tryrdlock
893
PTH_FUNC(int, pthreadZurwlockZutryrdlock, // pthread_rwlock_tryrdlock
894
pthread_rwlock_t* rwlock)
898
VALGRIND_GET_ORIG_FN(fn);
900
fprintf(stderr, "<< pthread_rwl_tryrlk %p", rwlock); fflush(stderr);
903
DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
904
pthread_rwlock_t*,rwlock,
905
long,0/*!isW*/, long,1/*isTryLock*/);
907
CALL_FN_W_W(ret, fn, rwlock);
909
/* There's a hole here: libpthread now knows the lock is locked,
910
but the tool doesn't, so some other thread could run and detect
911
that the lock has been acquired by someone (this thread). Does
912
this matter? Not sure, but I don't think so. */
914
if (ret == 0 /*success*/) {
915
DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_POST,
916
pthread_rwlock_t*,rwlock, long,0/*!isW*/);
919
DO_PthAPIerror( "pthread_rwlock_tryrdlock", ret );
923
fprintf(stderr, " :: rwl_tryrlk -> %d >>\n", ret);
929
// pthread_rwlock_unlock
851
930
PTH_FUNC(int, pthreadZurwlockZuunlock, // pthread_rwlock_unlock
852
931
pthread_rwlock_t* rwlock)