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

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Dec 13 16:13:09 AEDT 2010


On Mon, 13 Dec 2010, Paul Bone wrote:

> 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.

Done.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list