Hello, In my work, i have to use mono with a specific thread library. Mono with the use of this library show some race conditions that i've tried to fixed. In the patch we can see three modifications of the file mini.c. The first two are modifications which avoid to put two times the same fonction in a table. The last modification (which corresponds to the two last modifications on the patch) was done since we have plenty of bugs which aren't reproductibles, but all theses bugs have this fonction as a common point. In this way we have just extend the critical section. this modifications permits to run our tests program without any scratch.
yours sincerely Ps: the version of mono i used is the 1.1.16.1 ------------------------------------------------------------------- Subete ga wakatta toki…watashi ga anta wo korosu.
diff -abur mono-1.1.16.1/mono/mini/mini.c mono-1.1.16.1.1/mono/mini/mini.c --- mono-1.1.16.1/mono/mini/mini.c 2006-07-05 23:55:50.000000000 +0200 +++ mono-1.1.16.1.1/mono/mini/mini.c 2006-08-04 09:22:11.418560308 +0200 @@ -2848,12 +2848,15 @@ info = mono_find_jit_icall_by_name (icall_name); if (info == NULL) { + mono_jit_lock (); + info = mono_find_jit_icall_by_name (icall_name); + if (info == NULL) { esig = mono_get_array_new_va_signature (rank); name = g_strdup (icall_name); info = mono_register_jit_icall (mono_array_new_va, name, esig, FALSE); - mono_jit_lock (); g_hash_table_insert (jit_icall_name_hash, name, name); + } mono_jit_unlock (); } @@ -3052,13 +3055,18 @@ info = mono_find_jit_icall_by_name (icall_name); if (info == NULL) { + mono_jit_lock(); + info = mono_find_jit_icall_by_name (icall_name); + if(info==NULL){ esig = mono_get_element_address_signature (rank); name = g_strdup (icall_name); info = mono_register_jit_icall (ves_array_element_address, name, esig, FALSE); - mono_jit_lock (); + /*mono_jit_lock ();*/ g_hash_table_insert (jit_icall_name_hash, name, name); - mono_jit_unlock (); + /*mono_jit_unlock ();*/ + } + mono_jit_unlock(); } temp = mono_emit_native_call (cfg, bblock, mono_icall_get_wrapper (info), info->sig, sp, ip, FALSE, FALSE); @@ -10284,7 +10292,6 @@ } } - mono_domain_unlock (target_domain); p = mono_create_ftnptr (target_domain, mono_jit_compile_method_inner (method, target_domain, opt)); if (callinfo) { @@ -10296,7 +10303,7 @@ } mono_jit_unlock (); } - + mono_domain_unlock (target_domain); return p; }
_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list