Closed basvandijk closed 10 years ago
Oops, this breaks the build with GHC 7.0. Should we explicitly drop that version?
Oops, this breaks the build with GHC 7.0. Should we explicitly drop that version?
I think that's best. I used forkIOWithUnmask
which was first provided by base-4.4.0.0 (ghc-7.2.1). I just pushed a patch to master which bumps the minimal base version.
BTW just FYI here's an example of a visualized GHC event log file including resource-pool reaper threads.
Hi Bryan,
At Erudify we're doing some GHC event analysis work (using ghc-events-analyze). For that it's important that all threads in our program have a descriptive label. So I would like to push the Haskell community in the direction of labeling all internally created threads with the standard label:
<package-name>: <description>
.This patch labels the resource-pool's "reaper" thread in that way.
Note that the second patch fixes a current bug in resource-pool where the reaper thread can not be killed if the user created the pool in a masked context, i.e.:
When pool gets garbage collected the KillThread exception can't be delivered to the reaper thread because it inherited the masked state of the calling thread.
This could lead to a resource leak.
Now we use:
forkIOWithUnmask $ \unmask -> unmask ...
which ensures asynchronous exception can always be delivered to the reaper thread.