summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomanCheplyaka <>2017-09-12 06:10:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-09-12 06:10:00 (GMT)
commit7f0a8aa499b487b0868b6569d6bd9d6de895e14b (patch)
tree214ca6f4d9d83a6d46d4fe36d7e0cb6488272ff6
parent200ed2d5a98639922d45cca2399c78500b7ad11f (diff)
version 0.2.2.10.2.2.1
-rw-r--r--CHANGELOG.md5
-rw-r--r--README.md2
-rw-r--r--immortal.cabal11
-rw-r--r--tests/test.hs11
4 files changed, 26 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e9d758a..278673f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGES
=======
+Version 0.2.2.1
+---------------
+
+Fix the README
+
Version 0.2.2
-------------
diff --git a/README.md b/README.md
index b73575f..cb8bec7 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ A small library to create threads that never die. This is useful e.g. for
writing servers.
``` haskell
-import qualified System.Immortal as Immortal
+import qualified Control.Immortal as Immortal
import Control.Concurrent (threadDelay)
import Control.Monad (forever)
diff --git a/immortal.cabal b/immortal.cabal
index bec0b97..c1232e6 100644
--- a/immortal.cabal
+++ b/immortal.cabal
@@ -2,9 +2,12 @@
-- documentation, see http://haskell.org/cabal/users-guide/
name: immortal
-version: 0.2.2
+version: 0.2.2.1
synopsis: Spawn threads that never die (unless told to do so)
--- description:
+description: A small library to create threads that never die.
+
+ This is useful e.g. for writing servers.
+
homepage: https://github.com/feuerbach/immortal
license: MIT
license-file: LICENSE
@@ -18,6 +21,10 @@ extra-source-files:
CHANGELOG.md
cabal-version: >=1.10
+source-repository head
+ type: git
+ location: https://github.com/feuerbach/immortal.git
+
library
exposed-modules: Control.Immortal
-- other-modules:
diff --git a/tests/test.hs b/tests/test.hs
index 0372fc3..c1e2d3e 100644
--- a/tests/test.hs
+++ b/tests/test.hs
@@ -190,6 +190,17 @@ main = defaultMain $ testGroup "Tests"
result <- timeout (10^5) $ Immortal.wait thread
result @?= Just ()
+
+ , testCase "wait waits long enough" $ do
+ tv <- atomically $ newTVar True
+ thread <- Immortal.create $ \t -> do
+ delay
+ atomically $ writeTVar tv False
+ Immortal.stop t
+ _ <- Immortal.wait thread
+
+ v <- atomically $ readTVar tv
+ v @?= False
]
keepTrue :: TVar Bool -> IO ()