[m-rev.] for review: threadsafe version_arrays in Java

Peter Wang novalazy at gmail.com
Mon Apr 19 12:58:44 AEST 2010


On 19 April 2010 12:52, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> On Mon, Apr 19, 2010 at 12:17:15PM +1000, Peter Wang wrote:
>> >> @@ -691,6 +761,9 @@ ML_va_set(ML_va_ptr VA0, MR_Integer I, MR_Word X,
>> >> ML_va_ptr *VAptr)
>> >>          VA1->index      = -1;
>> >>          VA1->value      = (MR_Word) NULL;
>> >>          VA1->rest.array = VA0->rest.array;
>> >> +#ifdef MR_THREAD_SAFE
>> >> +        VA1->lock       = VA0->lock;
>> >> +#endif
...
>
> But do you know that this is a reference to the same lock (pointer to a lock)
> or just a copy of the lock?

Same lock.

struct ML_va {
    ...
#ifdef MR_THREAD_SAFE
    MercuryLock         *lock;  /* NULL or lock                  */
#endif
};

Peter

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