GHC 6.4.3 on FreeBSD (fwd)

Daniel Eischen deischen at freebsd.org
Mon Aug 7 17:15:23 UTC 2006


On Mon, 7 Aug 2006, Robert Watson wrote:

>
> I've been talking to the Haskell folk about problems they've had getting 
> their threaded runtime running on FreeBSD.  Here's one of their problem 
> reports. Since I'm not up on how threads and signals are supposed to act, I 
> can't confirm the below is a bug, of course, but figured you (experts) would 
> be able to respond better.

Try this patch.

-- 
DE

Index: thread/thr_sig.c
===================================================================
RCS file: /opt/FreeBSD/cvs/src/lib/libpthread/thread/thr_sig.c,v
retrieving revision 1.85
diff -u -r1.85 thr_sig.c
--- thread/thr_sig.c	9 Jun 2006 14:23:40 -0000	1.85
+++ thread/thr_sig.c	7 Aug 2006 16:37:50 -0000
@@ -1095,6 +1095,11 @@
  	struct pthread *curthread = _get_curthread();
  	struct kse_mailbox *kmbx;

+	if ((curthread->kse->k_flags & KF_STARTED) == 0) {
+		(void)__sys_kill(getpid(), sig);
+		return;
+	}
+
  	if (pthread->attr.flags & PTHREAD_SCOPE_SYSTEM) {
  		kse_thr_interrupt(&pthread->tcb->tcb_tmbx, KSE_INTR_SENDSIG, sig);
  		return;



More information about the freebsd-threads mailing list