Subject: Re: Thread problem in 3.3.0

From: Jan Wielemaker <[email-masked]>
Date: Mon, 31 Jan 2000 16:13:15 +0100

On Mon, 31 Jan 2000, Andrey Diatchkov wrote:

>main_cycle(LoggerId) :-
>        thread_send_message(LoggerId," first"),
>        thread_send_message(LoggerId," second"),
>	sleep(0.1),
>        !,
>        main_cycle(LoggerId).
>Result:
> first
> first
> first
> first
> . . .

This is indead a bug.  Actually a rather simple one.  Below is
the patch.  This fix will appear in 3.3.0#13.

	Thanks for reporting

		--- Jan

Index: pl-thread.c
===================================================================
RCS file: /usr/local/cvsroot/pl/src/pl-thread.c,v
retrieving revision 1.16
diff -u -w -r1.16 pl-thread.c
--- pl-thread.c	2000/01/29 17:00:52	1.16
+++ pl-thread.c	2000/01/31 15:10:01
@@ -885,7 +885,7 @@
       { if ( prev )
 	  prev->next = msgp->next;
 	else
-	  ld->thread.msg_head = ld->thread.msg_tail = NULL;
+	  ld->thread.msg_head = msgp->next;
 	PL_erase(msgp->message);
 	freeHeap(msgp, sizeof(*msgp));
 	UNLOCK();