Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jul 2006 09:35:56 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 101086 for review
Message-ID:  <200607090935.k699Zu8s083616@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101086

Change 101086 by rdivacky@rdivacky_witten on 2006/07/09 09:35:12

	Wakeup all blocked threads waiting for a futex in proc_exit() hook.

Affected files ...

.. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#12 edit

Differences ...

==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#12 (text+ko) ====

@@ -56,6 +56,7 @@
 
 #include <i386/linux/linux.h>
 #include <i386/linux/linux_proto.h>
+#include <compat/linux/linux_futex.h>
 #include <compat/linux/linux_ipc.h>
 #include <compat/linux/linux_signal.h>
 #include <compat/linux/linux_util.h>
@@ -1164,6 +1165,7 @@
 	}
 #endif
 	if (em->clear_tid != NULL) {
+	   	struct linux_sys_futex_args cup;
 		int null = 0;
 
 		error = copyout(&null, em->clear_tid, sizeof(null));
@@ -1172,7 +1174,16 @@
 		   	return (error);
 		}
 
-		/* TODO: futexes stuff */
+		/* futexes stuff */
+		cup.uaddr = em->clear_tid;
+		cup.op = LINUX_FUTEX_WAKE;
+		cup.val = 0x7fffffff; /* Awake everyone */
+		cup.timeout = NULL;
+		cup.uaddr2 = NULL;
+		cup.val3 = 0;
+		error = linux_sys_futex(td, &cup);
+		if (error)
+		   	printf("futex stuff in proc_exit failed.\n");
 	}
 
 	EMUL_RUNLOCK(&emul_lock);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607090935.k699Zu8s083616>