[threadpool-ms] Fix race condition on domain unload (#3592)
authorLudovic Henry <ludovic@xamarin.com>
Wed, 21 Sep 2016 09:16:35 +0000 (11:16 +0200)
committerGitHub <noreply@github.com>
Wed, 21 Sep 2016 09:16:35 +0000 (11:16 +0200)
commitd62c2c5fa56d8a181ad0d6531de4a96e7f25301c
tree77e9b584c4db16f239f03a45247a2b8dc727fb1f
parentf66549c12d0fb9cc09a47e5ad17e249ca56da734
[threadpool-ms] Fix race condition on domain unload (#3592)

This race condition has been introduced with 348d793ebb716012326b113fcdd7d4c855ffb01e. This is because we would wait on the cleanup_semaphore outside of the threadpool->domains_lock lock.

By using a cond variable instead of a semaphore, we avoid a potential deadlock.
mono/metadata/threadpool-ms.c