[sgen] Exclusive write on binary protocol file
[mono.git] / mono / sgen / sgen-gray.c
index 331484adf31dd7a993f403cf4d16e22898be63fc..809215136f9799d817b0b157d6c1ac972f085f93 100644 (file)
@@ -5,18 +5,7 @@
  * Copyright 2003-2010 Novell, Inc.
  * Copyright (C) 2012 Xamarin Inc
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License 2.0 as published by the Free Software Foundation;
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License 2.0 along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 #include "config.h"
 #ifdef HAVE_SGEN_GC
@@ -66,7 +55,7 @@ sgen_gray_object_alloc_queue_section (SgenGrayQueue *queue)
                STATE_TRANSITION (section, GRAY_QUEUE_SECTION_STATE_FREE_LIST, GRAY_QUEUE_SECTION_STATE_FLOATING);
        } else {
                /* Allocate a new section */
-               section = sgen_alloc_internal (INTERNAL_MEM_GRAY_QUEUE);
+               section = (GrayQueueSection *)sgen_alloc_internal (INTERNAL_MEM_GRAY_QUEUE);
                STATE_SET (section, GRAY_QUEUE_SECTION_STATE_FLOATING);
        }
 
@@ -96,7 +85,7 @@ sgen_gray_object_free_queue_section (GrayQueueSection *section)
  */
 
 void
-sgen_gray_object_enqueue (SgenGrayQueue *queue, char *obj, mword desc)
+sgen_gray_object_enqueue (SgenGrayQueue *queue, GCObject *obj, SgenDescriptor desc)
 {
        GrayQueueEntry entry = SGEN_GRAY_QUEUE_ENTRY (obj, desc);
 
@@ -292,7 +281,7 @@ lock_section_queue (SgenSectionGrayQueue *queue)
        if (!queue->locked)
                return;
 
-       mono_mutex_lock (&queue->lock);
+       mono_os_mutex_lock (&queue->lock);
 }
 
 static void
@@ -301,7 +290,7 @@ unlock_section_queue (SgenSectionGrayQueue *queue)
        if (!queue->locked)
                return;
 
-       mono_mutex_unlock (&queue->lock);
+       mono_os_mutex_unlock (&queue->lock);
 }
 
 void
@@ -311,7 +300,7 @@ sgen_section_gray_queue_init (SgenSectionGrayQueue *queue, gboolean locked, Gray
 
        queue->locked = locked;
        if (locked) {
-               mono_mutex_init_recursive (&queue->lock);
+               mono_os_mutex_init_recursive (&queue->lock);
        }
 
 #ifdef SGEN_CHECK_GRAY_OBJECT_ENQUEUE