mono/mono — pull request #656 by tjphilpot (2013-06-07 05:11:19+00:00)
Title: Take shared file lock before collecting file share_info.

I realize that shared handles are basically deprecated since Mono 2.8, but we still use them to emulate the Windows behavior under Mono.

In trying to track down a crash in one of our applications which uses shared handles, I noticed that _wapi_handle_collect() in collection.c does not lock _WAPI_SHARED_SEM_FILESHARE before performing a collection. I could not reproduce the crash I was investigating or induce any other race condition related to not taking the lock, but it does seem like an oversight, since every other mutation of share_info is protected by _WAPI_SHARED_SEM_FILESHARE.