Merge Helgrind from branches/YARD into the trunk. Also includes some
minor changes to make stack unwinding on amd64-linux approximately
twice as fast as it was before.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8707 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c
index 8e988e6..172edfe 100644
--- a/helgrind/hg_intercepts.c
+++ b/helgrind/hg_intercepts.c
@@ -534,9 +534,10 @@
/* Handled: pthread_cond_wait pthread_cond_timedwait
pthread_cond_signal pthread_cond_broadcast
+ pthread_cond_destroy
- Unhandled: pthread_cond_init pthread_cond_destroy
- -- are these important?
+ Unhandled: pthread_cond_init
+ -- is this important?
*/
// pthread_cond_wait
@@ -719,6 +720,73 @@
}
+// pthread_cond_destroy
+PTH_FUNC(int, pthreadZucondZudestroyZAZa, // pthread_cond_destroy@*
+ pthread_cond_t* cond)
+{
+ int ret;
+ OrigFn fn;
+
+ VALGRIND_GET_ORIG_FN(fn);
+
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, "<< pthread_cond_destroy %p", cond);
+ fflush(stderr);
+ }
+
+ DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_COND_DESTROY_PRE,
+ pthread_cond_t*,cond);
+
+ CALL_FN_W_W(ret, fn, cond);
+
+ if (ret != 0) {
+ DO_PthAPIerror( "pthread_cond_destroy", ret );
+ }
+
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, " codestr -> %d >>\n", ret);
+ }
+
+ return ret;
+}
+
+
+/*----------------------------------------------------------------*/
+/*--- pthread_barrier_t functions ---*/
+/*----------------------------------------------------------------*/
+
+PTH_FUNC(int, pthreadZubarrierZuwait, // pthread_barrier_wait.
+ pthread_barrier_t* b)
+{
+ int ret;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, "<< pthread_barrier_wait %p", b);
+ fflush(stderr);
+ }
+
+ // We blocked, signal.
+ DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_COND_BROADCAST_PRE,
+ void*,b);
+ CALL_FN_W_W(ret, fn, b);
+
+ // FIXME: handle ret
+
+ // We unblocked, finish wait.
+ DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_COND_WAIT_POST,
+ void *, b, void *, b);
+
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, " pthread_barrier_wait -> %d >>\n", ret);
+ }
+
+ return ret;
+}
+
+
+
/*----------------------------------------------------------------*/
/*--- pthread_rwlock_t functions ---*/
/*----------------------------------------------------------------*/