[m-rev.] for review: support pthreads-win32 on mingw

Paul Bone pbone at csse.unimelb.edu.au
Mon Dec 13 16:00:56 AEDT 2010


On Mon, Dec 13, 2010 at 02:08:47AM +1100, Julien Fischer wrote:
> 
> Branches: main, 10.04
> 
> Index: runtime/mercury_thread.c
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_thread.c,v
> retrieving revision 1.44
> diff -u -r1.44 mercury_thread.c
> --- runtime/mercury_thread.c	6 Dec 2010 14:41:34 -0000	1.44
> +++ runtime/mercury_thread.c	12 Dec 2010 15:02:56 -0000
> @@ -299,13 +305,22 @@
>      int err;
> 
>      fprintf(stderr, "%ld timed-waiting on cond: %p lock: %p (%s)\n",
> -        (long)pthread_self(), cond, lock, from);
> +        SELF_THREAD_ID, cond, lock, from);
>      err = pthread_cond_timedwait(cond, lock, abstime);
>      fprintf(stderr, "%ld timed-wait returned %d\n",
> -        (long)pthread_self(), err);
> +        SELF_THREAD_ID, err);
>      return err;
>  }
> 
> +#if defined(MR_PTHREADS_WIN32)
> +MercuryThread
> +MR_null_thread(void)
> +{
> +    const MercuryThread null_thread = {NULL, 0};
> +    return null_thread;
> +}
> +#endif /* MR_PTHREADS_WIN32 */
> +
>  #endif  /* MR_THREAD_SAFE */
> 
>  MR_Unsigned

It looks as if MR_null_thread() is missing when MR_PTHREADS_WIN32 is undefined.
Please add a comment telling the reader that it's a macro in this canse and can
therefore be found in the header file.

Everything else is fine.

Thanks.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20101213/a2dc513d/attachment.sig>


More information about the reviews mailing list