|
From: <sv...@va...> - 2008-02-24 18:22:35
|
Author: bart
Date: 2008-02-24 18:22:37 +0000 (Sun, 24 Feb 2008)
New Revision: 7441
Log:
Fixed a memory leak and renamed one variable.
Modified:
trunk/exp-drd/drd_mutex.c
Modified: trunk/exp-drd/drd_mutex.c
===================================================================
--- trunk/exp-drd/drd_mutex.c 2008-02-24 18:21:12 UTC (rev 7440)
+++ trunk/exp-drd/drd_mutex.c 2008-02-24 18:22:37 UTC (rev 7441)
@@ -332,7 +332,7 @@
/* 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 @@
}
/**
- * 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;
}
|