[project @ 2002-12-10 13:38:40 by wolfgang] Fix a race condition/possible deadlock in the threaded rts:
[project @ 2002-12-10 13:38:40 by wolfgang]
Fix a race condition/possible deadlock in the threaded rts:

If a callback into haskell finished before waitThread_() was called,
the signal was lost  ans waitThread_() waited indefinitely.

Solution: Don't release the sched_mutex between calls to scheduleThread_
and waitThread_.

Please note that the scheduler API function waitThread is still possibly
affected by this race condition. It's used in rts_mainEvalIO (I think that's
safe) and in finishAllThreads (this looks dangerous, but finishAllThreads is
never used).

nkaretnikov/ghc,acowley/ghc,gridaphobe/ghc,nomeata/ghc,nathyong/microghc-ghc,vikraman/ghc,GaloisInc/halvm-ghc,wxwxwwxxx/ghc,christiaanb/ghc,sgillespie/ghc,gcampax/ghc,ghc-android/ghc,mcschroeder/ghc,elieux/ghc,ekmett/ghc,mcschroeder/ghc,ryantm/ghc,mfine/ghc,mettekou/ghc,nomeata/ghc,vikraman/ghc,ekmett/ghc,nomeata/ghc,tjakway/ghcjvm,christiaanb/ghc,mcschroeder/ghc,forked-upstream-packages-for-ghcjs/ghc,gcampax/ghc,tibbe/ghc,fmthoma/ghc,GaloisInc/halvm-ghc,lukexi/ghc,ml9951/ghc,mcmaniac/ghc,mcmaniac/ghc,mfine/ghc,da-x/ghc,anton-dessiatov/ghc,urbanslug/ghc,da-x/ghc,bitemyapp/ghc,lukexi/ghc-7.8-arm64,snoyberg/ghc,olsner/ghc,nathyong/microghc-ghc,bitemyapp/ghc,gridaphobe/ghc,bitemyapp/ghc,ghc-android/ghc,wxwxwwxxx/ghc,nkaretnikov/ghc,vTurbine/ghc,lukexi/ghc-7.8-arm64,ilyasergey/GHC-XAppFix,spacekitteh/smcghc,christiaanb/ghc,fmthoma/ghc,mfine/ghc,TomMD/ghc,anton-dessiatov/ghc,vikraman/ghc,forked-upstream-packages-for-ghcjs/ghc,nushio3/ghc,anton-dessiatov/ghc,forked-upstream-packages-for-ghcjs/ghc,green-haskell/ghc,wxwxwwxxx/ghc,urbanslug/ghc,ml9951/ghc,fmthoma/ghc,hferreiro/replay,nkaretnikov/ghc,urbanslug/ghc,ghc-android/ghc,tibbe/ghc,ml9951/ghc,elieux/ghc,holzensp/ghc,shlevy/ghc,sdiehl/ghc,ghc-android/ghc,christiaanb/ghc,ezyang/ghc,christiaanb/ghc,nushio3/ghc,gridaphobe/ghc,lukexi/ghc-7.8-arm64,sgillespie/ghc,green-haskell/ghc,nushio3/ghc,oldmanmike/ghc,siddhanathan/ghc,ml9951/ghc,oldmanmike/ghc,holzensp/ghc,siddhanathan/ghc,hferreiro/replay,nushio3/ghc,siddhanathan/ghc,acowley/ghc,sgillespie/ghc,TomMD/ghc,gridaphobe/ghc,elieux/ghc,jstolarek/ghc,mettekou/ghc,AlexanderPankiv/ghc,ml9951/ghc,green-haskell/ghc,anton-dessiatov/ghc,spacekitteh/smcghc,shlevy/ghc,sdiehl/ghc,mettekou/ghc,gridaphobe/ghc,tjakway/ghcjvm,tibbe/ghc,sdiehl/ghc,ezyang/ghc,tibbe/ghc,ghc-android/ghc,shlevy/ghc,gcampax/ghc,nkaretnikov/ghc,mettekou/ghc,forked-upstream-packages-for-ghcjs/ghc,spacekitteh/smcghc,nathyong/microghc-ghc,nushio3/ghc,holzensp/ghc,nkaretnikov/ghc,AlexanderPankiv/ghc,nkaretnikov/ghc,vikraman/ghc,elieux/ghc,gcampax/ghc,vTurbine/ghc,TomMD/ghc,siddhanathan/ghc,ryantm/ghc,mcschroeder/ghc,frantisekfarka/ghc-dsi,holzensp/ghc,ezyang/ghc,spacekitteh/smcghc,wxwxwwxxx/ghc,GaloisInc/halvm-ghc,sdiehl/ghc,mcmaniac/ghc,hferreiro/replay,olsner/ghc,tjakway/ghcjvm,acowley/ghc,ilyasergey/GHC-XAppFix,tibbe/ghc,da-x/ghc,ml9951/ghc,ezyang/ghc,ekmett/ghc,bitemyapp/ghc,GaloisInc/halvm-ghc,lukexi/ghc,snoyberg/ghc,GaloisInc/halvm-ghc,ekmett/ghc,lukexi/ghc,TomMD/ghc,gridaphobe/ghc,ezyang/ghc,green-haskell/ghc,ml9951/ghc,TomMD/ghc,spacekitteh/smcghc,hferreiro/replay,snoyberg/ghc,ilyasergey/GHC-XAppFix,acowley/ghc,sgillespie/ghc,siddhanathan/ghc,mfine/ghc,frantisekfarka/ghc-dsi,frantisekfarka/ghc-dsi,lukexi/ghc-7.8-arm64,fmthoma/ghc,mcschroeder/ghc,gcampax/ghc,ml9951/ghc,da-x/ghc,nathyong/microghc-ghc,nomeata/ghc,GaloisInc/halvm-ghc,mcmaniac/ghc,nushio3/ghc,AlexanderPankiv/ghc,snoyberg/ghc,wxwxwwxxx/ghc,vTurbine/ghc,elieux/ghc,urbanslug/ghc,jstolarek/ghc,sdiehl/ghc,mettekou/ghc,sgillespie/ghc,da-x/ghc,tjakway/ghcjvm,sgillespie/ghc,elieux/ghc,vikraman/ghc,anton-dessiatov/ghc,siddhanathan/ghc,shlevy/ghc,shlevy/ghc,mcschroeder/ghc,gridaphobe/ghc,ghc-android/ghc,TomMD/ghc,vTurbine/ghc,sdiehl/ghc,holzensp/ghc,acowley/ghc,urbanslug/ghc,gcampax/ghc,AlexanderPankiv/ghc,da-x/ghc,mcschroeder/ghc,siddhanathan/ghc,shlevy/ghc,elieux/ghc,ezyang/ghc,forked-upstream-packages-for-ghcjs/ghc,olsner/ghc,TomMD/ghc,lukexi/ghc-7.8-arm64,jstolarek/ghc,urbanslug/ghc,green-haskell/ghc,nathyong/microghc-ghc,GaloisInc/halvm-ghc,nomeata/ghc,olsner/ghc,ghc-android/ghc,mfine/ghc,oldmanmike/ghc,nathyong/microghc-ghc,shlevy/ghc,mettekou/ghc,fmthoma/ghc,tjakway/ghcjvm,fmthoma/ghc,ilyasergey/GHC-XAppFix,vikraman/ghc,da-x/ghc,AlexanderPankiv/ghc,frantisekfarka/ghc-dsi,nushio3/ghc,hferreiro/replay,oldmanmike/ghc,jstolarek/ghc,sgillespie/ghc,AlexanderPankiv/ghc,oldmanmike/ghc,mfine/ghc,olsner/ghc,tjakway/ghcjvm,acowley/ghc,anton-dessiatov/ghc,vTurbine/ghc,ekmett/ghc,hferreiro/replay,ryantm/ghc,christiaanb/ghc,nkaretnikov/ghc,bitemyapp/ghc,ryantm/ghc,hferreiro/replay,vTurbine/ghc,anton-dessiatov/ghc,mfine/ghc,lukexi/ghc,acowley/ghc,olsner/ghc,christiaanb/ghc,mettekou/ghc,fmthoma/ghc,tjakway/ghcjvm,lukexi/ghc,AlexanderPankiv/ghc,jstolarek/ghc,snoyberg/ghc,wxwxwwxxx/ghc,urbanslug/ghc,forked-upstream-packages-for-ghcjs/ghc,gcampax/ghc,snoyberg/ghc,ezyang/ghc,vTurbine/ghc,wxwxwwxxx/ghc,oldmanmike/ghc,nathyong/microghc-ghc,sdiehl/ghc,ryantm/ghc,oldmanmike/ghc,olsner/ghc,vikraman/ghc,snoyberg/ghc,forked-upstream-packages-for-ghcjs/ghc,mcmaniac/ghc,frantisekfarka/ghc-dsi