[M3devel] thread calls on non-modula3 threads, win32 vs. posix

Tony Hosking hosking at cs.purdue.edu
Sat Sep 25 16:32:21 CEST 2010


Is it ok in the WIn32 implementation for the thread to be native.
I think it is ok for pthread.

On 25 Sep 2010, at 05:35, Jay K wrote:

> 
> PROCEDURE AlertWait (m: Mutex; c: Condition) RAISES {Alerted} =
>   (* LL = m *)
>   VAR self := GetActivation();
>   BEGIN
>     IF DEBUG THEN ThreadDebug.AlertWait(m, c); END;
>     IF self = NIL THEN Die(ThisLine(), "AlertWait called from non-Modula-3 thread") END;
>     XWait(m, c, self, alertable := TRUE);
>   END AlertWait;
> 
> 
> The pthread code doesn't have the check for NIL and call to Die.
> Nor for that matter, the uses of ThreadDebug -- which I added.
> 
> I think these should be more similar.
> 
> What I was really wondering about, again, is more common code between Win32 and Posix
> in the thread code... 
> 
>  - Jay
> 		 	   		  




More information about the M3devel mailing list