* boehm-gc.c: fixed race condition while getting the target of a
disappearing link (bug #522233).
svn path=/trunk/mono/; revision=148105
+
+Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <lupus@ximian.com>
+
+ * boehm-gc.c: fixed race condition while getting the target of a
+ disappearing link (bug #522233).
+
2009-12-10 Rodrigo Kumpera <rkumpera@novell.com>
* class.c (mono_type_get_full): Produce warning instead of simply swallowing
*link_addr = NULL;
}
+static gpointer
+reveal_link (gpointer link_addr)
+{
+ void **link_a = link_addr;
+ return REVEAL_POINTER (*link_a);
+}
+
MonoObject*
mono_gc_weak_link_get (void **link_addr)
{
- MonoObject *obj = REVEAL_POINTER (*link_addr);
+ MonoObject *obj = GC_call_with_alloc_lock (reveal_link, link_addr);
if (obj == (MonoObject *) -1)
return NULL;
return obj;