Commit 98329cb329566e593291caeac4be01d3eacaf280

Kano 2013-11-14T01:17:57

api.c trylock() add missing locklock

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/api.c b/api.c
index 07f6c39..302196d 100644
--- a/api.c
+++ b/api.c
@@ -1625,10 +1625,14 @@ uint64_t api_trylock(void *lock, const char *file, const char *func, const int l
 	LOCKINFO *info;
 	uint64_t id;
 
+	locklock();
+
 	info = findlock(lock, CGLOCK_UNKNOWN, file, func, linenum);
 	id = lock_id++;
 	addgettry(info, id, file, func, linenum, false);
 
+	lockunlock();
+
 	return id;
 }