Skip to content
Browse files

[sgen] Try to fix Win32 build.

  • Loading branch information...
1 parent af4194f commit 7340b8ffeb71caedfe05fb0c8fff2d808dd90544 @schani schani committed Dec 12, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 mono/metadata/sgen-gray.c
View
9 mono/metadata/sgen-gray.c
@@ -256,10 +256,19 @@ sgen_section_gray_queue_init (SgenSectionGrayQueue *queue, gboolean locked, Gray
queue->locked = locked;
if (locked) {
+#ifdef HOST_WIN32
+ /*
+ * mono_mutex_t is a critical section on Win32, which
+ * is recursive by default. mono_mutexattr_t is not
+ * defined there.
+ */
+ mono_mutex_init (&queue->lock, NULL);
+#else
mono_mutexattr_t attr;
mono_mutexattr_init (&attr);
mono_mutexattr_settype (&attr, MONO_MUTEX_RECURSIVE);
mono_mutex_init (&queue->lock, &attr);
+#endif
}
#ifdef SGEN_CHECK_GRAY_OBJECT_ENQUEUE

0 comments on commit 7340b8f

Please sign in to comment.
Something went wrong with that request. Please try again.