From: Bart Van Assche Date: Sun, 24 Feb 2008 18:22:37 +0000 (+0000) Subject: Fixed a memory leak and renamed one variable. X-Git-Tag: svn/VALGRIND_3_4_0~1051 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f96ea34f6c9016179f8881001c8431fea173a9fe;p=thirdparty%2Fvalgrind.git Fixed a memory leak and renamed one variable. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7441 --- diff --git a/exp-drd/drd_mutex.c b/exp-drd/drd_mutex.c index dc517f84da..b9dfea4915 100644 --- a/exp-drd/drd_mutex.c +++ b/exp-drd/drd_mutex.c @@ -332,7 +332,7 @@ int mutex_unlock(const Addr mutex, const MutexT mutex_type) /* This pthread_mutex_unlock() call really unlocks the mutex. Save the */ /* current vector clock of the thread such that it is available when */ /* this mutex is locked again. */ - vc_copy(&p->vc, vc); + vc_assign(&p->vc, vc); thread_new_segment(drd_tid); } @@ -385,18 +385,18 @@ int mutex_get_recursion_count(const Addr mutex) } /** - * Call this function when thread threadid stops to exist, such that the + * Call this function when thread tid stops to exist, such that the * "last owner" field can be cleared if it still refers to that thread. * TO DO: print an error message if a thread exits while it still has some * mutexes locked. */ -void mutex_thread_delete(const DrdThreadId threadid) +void mutex_thread_delete(const DrdThreadId tid) { int i; for (i = 0; i < sizeof(s_mutex)/sizeof(s_mutex[0]); i++) { struct mutex_info* const p = &s_mutex[i]; - if (p->mutex && p->owner == threadid) + if (p->mutex && p->owner == tid) { p->owner = VG_INVALID_THREADID; }