When using rts_setInCallCapability, lock incall threads
This diff makes sure that incall threads, when using `rts_setInCallCapability`, will be created as locked. If the thread is not locked, the thread might end up being scheduled to a different capability. While this is mentioned in the docs for `rts_setInCallCapability,`, it makes the method significantly less useful as there is no guarantees on the capability being used. This commit also adds a test to make sure things stay on the correct capability.
Showing
- compiler/GHC/HsToCore/Foreign/Decl.hs 4 additions, 4 deletionscompiler/GHC/HsToCore/Foreign/Decl.hs
- includes/RtsAPI.h 4 additions, 4 deletionsincludes/RtsAPI.h
- rts/RtsAPI.c 20 additions, 0 deletionsrts/RtsAPI.c
- rts/RtsSymbols.c 1 addition, 0 deletionsrts/RtsSymbols.c
- testsuite/tests/ffi/should_run/IncallAffinity.hs 36 additions, 0 deletionstestsuite/tests/ffi/should_run/IncallAffinity.hs
- testsuite/tests/ffi/should_run/IncallAffinity_c.c 78 additions, 0 deletionstestsuite/tests/ffi/should_run/IncallAffinity_c.c
- testsuite/tests/ffi/should_run/all.T 2 additions, 0 deletionstestsuite/tests/ffi/should_run/all.T
Loading
Please register or sign in to comment