From: Tom Philpot Date: Fri, 7 Jun 2013 04:28:20 +0000 (-0700) Subject: Take shared file lock before collecting file share_info. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=aeed8baa68fd96b91282ea76eb3af822f50f07b2;p=mono.git Take shared file lock before collecting file share_info. --- diff --git a/mono/io-layer/collection.c b/mono/io-layer/collection.c index 9190d2d9087..a42bbadcfe0 100644 --- a/mono/io-layer/collection.c +++ b/mono/io-layer/collection.c @@ -92,6 +92,9 @@ void _wapi_handle_collect (void) thr_ret = _wapi_handle_lock_shared_handles (); g_assert (thr_ret == 0); + thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_FILESHARE); + g_assert (thr_ret == 0); + DEBUG ("%s: (%d) Master set", __func__, _wapi_getpid ()); /* If count has changed, someone else jumped in as master */ @@ -120,6 +123,9 @@ void _wapi_handle_collect (void) InterlockedIncrement ((gint32 *)&_wapi_shared_layout->collection_count); } + thr_ret = _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_FILESHARE); + g_assert (thr_ret == 0); + _wapi_handle_unlock_shared_handles (); DEBUG ("%s: (%d) Collection done", __func__, _wapi_getpid ());