+2009-01-07 Miguel de Icaza <miguel@novell.com>
+
+ * icall.c: Wrap calls to mono_strtod in CriticalSection
+ invocations when using eglib, to work around #464316.
+
2009-01-07 Rodrigo Kumpera <rkumpera@novell.com>
* file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
return !type->byref && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR);
}
+#ifdef _EGLIB_MAJOR
+/* Need to lock here because EGLIB has locking defined as no-ops, we can not depend on mono_strtod do the right locking */
+/* Ideally this will be fixed in eglib */
+static CRITICAL_SECTION loader_mutex;
+#endif
+
/*
* We expect a pointer to a char, not a string
*/
if (*ptr)
*result = strtod (ptr, &endptr);
#else
- if (*ptr)
+ if (*ptr){
+#ifdef _EGLIB_MAJOR
+ /* Need to lock here because EGLIB has locking defined as no-ops, and that breaks mono_strtod */
+ EnterCriticalSection (&strtod_mutex);
*result = mono_strtod (ptr, &endptr);
+ LeaveCriticalSection (&strtod_mutex);
+#else
+ *result = mono_strtod (ptr, &endptr);
+#endif
+ }
#endif
if (!*ptr || (endptr && *endptr))