[io-layer] Replace remaining pthread_cond_t by mono_cond_t
authorLudovic Henry <ludovic@xamarin.com>
Fri, 24 Jun 2016 13:46:15 +0000 (15:46 +0200)
committerLudovic Henry <ludovic@xamarin.com>
Fri, 24 Jun 2016 13:47:19 +0000 (15:47 +0200)
mono/io-layer/handles-private.h
mono/io-layer/handles.c
mono/io-layer/wapi-private.h

index d2f5958aaaeb1e4386bd1eb5a579c4eee0c62786..81b17ea2f6bec3043d6f5c869b6cd9180cada650 100644 (file)
@@ -33,7 +33,7 @@ extern struct _WapiHandleUnshared *_wapi_private_handles [];
 extern guint32 _wapi_fd_reserve;
 extern gpointer _wapi_global_signal_handle;
 extern mono_mutex_t *_wapi_global_signal_mutex;
-extern pthread_cond_t *_wapi_global_signal_cond;
+extern mono_cond_t *_wapi_global_signal_cond;
 extern int _wapi_sem_id;
 extern gboolean _wapi_has_shut_down;
 
@@ -133,23 +133,23 @@ static inline void _wapi_handle_set_signal_state (gpointer handle,
                handle_data->signalled=state;
                
                if (broadcast == TRUE) {
-                       thr_ret = pthread_cond_broadcast (&handle_data->signal_cond);
+                       thr_ret = mono_os_cond_broadcast (&handle_data->signal_cond);
                        if (thr_ret != 0)
-                               g_warning ("Bad call to pthread_cond_broadcast result %d for handle %p", thr_ret, handle);
+                               g_warning ("Bad call to mono_os_cond_broadcast result %d for handle %p", thr_ret, handle);
                        g_assert (thr_ret == 0);
                } else {
-                       thr_ret = pthread_cond_signal (&handle_data->signal_cond);
+                       thr_ret = mono_os_cond_signal (&handle_data->signal_cond);
                        if (thr_ret != 0)
-                               g_warning ("Bad call to pthread_cond_signal result %d for handle %p", thr_ret, handle);
+                               g_warning ("Bad call to mono_os_cond_signal result %d for handle %p", thr_ret, handle);
                        g_assert (thr_ret == 0);
                }
 
                /* Tell everyone blocking on multiple handles that something
                 * was signalled
                 */                     
-               thr_ret = pthread_cond_broadcast (_wapi_global_signal_cond);
+               thr_ret = mono_os_cond_broadcast (_wapi_global_signal_cond);
                if (thr_ret != 0)
-                       g_warning ("Bad call to pthread_cond_broadcast result %d for handle %p", thr_ret, handle);
+                       g_warning ("Bad call to mono_os_cond_broadcast result %d for handle %p", thr_ret, handle);
                g_assert (thr_ret == 0);
                        
                thr_ret = mono_os_mutex_unlock (_wapi_global_signal_mutex);
index 83317f7a59486c2f329fabcebf90315cdda02293..0dd315176950c2399267ade7665aa14f78b3b0f5 100644 (file)
@@ -142,7 +142,7 @@ gpointer _wapi_global_signal_handle;
 
 /* Point to the mutex/cond inside _wapi_global_signal_handle */
 mono_mutex_t *_wapi_global_signal_mutex;
-pthread_cond_t *_wapi_global_signal_cond;
+mono_cond_t *_wapi_global_signal_cond;
 
 int _wapi_sem_id;
 gboolean _wapi_has_shut_down = FALSE;
@@ -324,7 +324,7 @@ static void _wapi_handle_init (struct _WapiHandleUnshared *handle,
        handle->signalled = FALSE;
        handle->ref = 1;
        
-       thr_ret = pthread_cond_init (&handle->signal_cond, NULL);
+       thr_ret = mono_os_cond_init (&handle->signal_cond);
        g_assert (thr_ret == 0);
                        
        thr_ret = mono_os_mutex_init (&handle->signal_mutex);
@@ -1124,7 +1124,7 @@ void _wapi_handle_unlock_handles (guint32 numhandles, gpointer *handles)
 static void
 signal_handle_and_unref (gpointer handle)
 {
-       pthread_cond_t *cond;
+       mono_cond_t *cond;
        mono_mutex_t *mutex;
        guint32 idx;
 
@@ -1151,7 +1151,7 @@ _wapi_handle_timedwait_signal_handle (gpointer handle, guint32 timeout, gboolean
 {
        guint32 idx;
        int res;
-       pthread_cond_t *cond;
+       mono_cond_t *cond;
        mono_mutex_t *mutex;
 
        MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: waiting for %p (type %s)", __func__, handle,
index 798626e1a41d515f2f4a05dfc4d7be4af0e5f0ed..e82d8e68f660ffbe21c3add129c20ef801b8eac3 100644 (file)
@@ -123,7 +123,7 @@ struct _WapiHandleUnshared
        guint ref;
        gboolean signalled;
        mono_mutex_t signal_mutex;
-       pthread_cond_t signal_cond;
+       mono_cond_t signal_cond;
        
        union 
        {