Index: trunk/xcache/xc_lock.c
===================================================================
--- trunk/xcache/xc_lock.c	(revision 1027)
+++ trunk/xcache/xc_lock.c	(revision 1154)
@@ -88,5 +88,5 @@
 
 	if (pathname == NULL) {
-		static int i = 0;
+		static int instanceId = 0;
 		const char default_tmpdir[] = { DEFAULT_SLASH, 't', 'm', 'p', '\0' };
 		const char *tmpdir;
@@ -101,5 +101,5 @@
 		size = strlen(tmpdir) + sizeof("/.xcache.lock") - 1 + 3 * 10 + 100;
 		myname = malloc(size);
-		snprintf(myname, size - 1, "%s%c.xcache.%d.%d.%d.lock", tmpdir, DEFAULT_SLASH, (int) getuid(), i ++, rand());
+		snprintf(myname, size - 1, "%s%c.xcache.%d.%d.%d.lock", tmpdir, DEFAULT_SLASH, (int) getuid(), (int) getpid(), ++instanceId);
 		pathname = myname;
 	}
