jwiegley / async-pool

Other
21 stars 13 forks source link

Nested calls to mapTasks hang indefinitely #32

Open maksar opened 4 months ago

maksar commented 4 months ago

test/main.hs has the following test, which passes

      it "nested mapTasks work" $ withTaskGroup 1 $ \p -> do
          mapTasks p ([mapTasks p [pure ()]])
          True `shouldBe` True

However, that test hangs indefinitely (fails with test: thread blocked indefinitely in an MVar operation):

      it "nested mapTasks work" $ withTaskGroup 1 $ \p -> do
          mapTasks p ([mapTasks p [pure ()], mapTasks p [pure ()]])
          True `shouldBe` True
maksar commented 4 months ago

Looks like https://github.com/jwiegley/async-pool/pull/26 (attempt to fix https://github.com/jwiegley/async-pool/issues/4) wasn't robust enough @l29ah