Fix ForeignThreadExceptions test (dotnet/coreclr#25074)
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 11 Jun 2019 22:42:46 +0000 (00:42 +0200)
committerJan Kotas <jkotas@microsoft.com>
Tue, 11 Jun 2019 22:42:46 +0000 (15:42 -0700)
commit4a4ae4dd7ae7ba765931eb70560b085deef77253
treec2cdb136c0cc71a6fce056168fe65ad0ebb4faf1
parentc4a1b3047510039de99eabe2bb14841b88d4d7b2
Fix ForeignThreadExceptions test (dotnet/coreclr#25074)

This test creates a native thread on which it calls a managed callback. It uses
std::thread to create the thread. The problem is that on MUSL based Linux distros,
the default stack size for secondary threads is 80kB, which is not enough for this
test.
Since std::thread has no way to set the thread stack size, the fix is to use
pthreads on Unix and keep the std::thread for Windows only.

Commit migrated from https://github.com/dotnet/coreclr/commit/1eee9e5338118aeb6afa199658b2fdd4f318414e
src/coreclr/tests/src/Exceptions/ForeignThread/CMakeLists.txt
src/coreclr/tests/src/Exceptions/ForeignThread/ForeignThreadExceptionsNative.cpp