Change new thread's affinity after thread starts, from the same thread, as a workarou...
authorKoundinya Veluri <kouvel@users.noreply.github.com>
Tue, 4 Aug 2020 04:17:46 +0000 (00:17 -0400)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2020 04:17:46 +0000 (21:17 -0700)
commit6991ccd1e8cdfb640a74be7db54e81f456406d1f
treecaf0e48cc4f673c6fb3087755de35a872df933e6
parentcb5b205838cc8eab7cc017a83fd667cacb6b04ce
Change new thread's affinity after thread starts, from the same thread, as a workaround for Snap (#40205)

- Snap's default strict confinement doesn't allow setting the affinity of a different thread, and currently doesn't allow `sched_setaffinity(<nonzeroPid>, ...)`, which pthread implementation calls
- Switched to use sched_setaffinity(0, ...) where appropriate

Fix for https://github.com/dotnet/runtime/issues/1634 in master
src/coreclr/src/gc/unix/config.gc.h.in
src/coreclr/src/gc/unix/configure.cmake
src/coreclr/src/gc/unix/gcenv.unix.cpp
src/coreclr/src/pal/src/config.h.in
src/coreclr/src/pal/src/configure.cmake
src/coreclr/src/pal/src/thread/thread.cpp