[m-rev.] for review: threadsafe version_arrays in Java
Paul Bone
pbone at csse.unimelb.edu.au
Mon Apr 19 13:12:00 AEST 2010
On Mon, Apr 19, 2010 at 12:58:44PM +1000, Peter Wang wrote:
> 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
> };
>
Doh!
I forgot you where using a pointer as a 'maybe there is a lock' type.
Cheers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20100419/23e5b2b9/attachment.sig>
More information about the reviews
mailing list