PERFORCE change 104029 for review

Roman Divacky rdivacky at FreeBSD.org
Tue Aug 15 14:07:25 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=104029

Change 104029 by rdivacky at rdivacky_witten on 2006/08/15 14:06:41

	Protect against racing concurent creation in futex_get()
	
	Pointed out by: jhb

Affected files ...

.. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_futex.c#24 edit

Differences ...

==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_futex.c#24 (text+ko) ====

@@ -342,13 +342,13 @@
 	if (locked == FUTEX_UNLOCKED)
    	   	FUTEX_UNLOCK;
 
+	if (locked == FUTEX_UNLOCKED)
+   	   	FUTEX_LOCK;
 	/* Not found, create it */
 	f = malloc(sizeof(*f), M_LINUX, M_WAITOK);
 	f->f_uaddr = uaddr;
 	f->f_refcount = 1;
 	TAILQ_INIT(&f->f_waiting_proc);
-	if (locked == FUTEX_UNLOCKED)
-   	   	FUTEX_LOCK;
 	LIST_INSERT_HEAD(&futex_list, f, f_list);
 	if (locked == FUTEX_UNLOCKED)
    	   	FUTEX_UNLOCK;


More information about the p4-projects mailing list