Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the thread version of AutoUpdate for non-threaded RTS #1020

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions auto-update/Control/AutoUpdate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,26 @@ module Control.AutoUpdate (
)
where

import Control.AutoUpdate.Types
#ifdef mingw32_HOST_OS
import Control.AutoUpdate.Thread
#else
import Control.AutoUpdate.Event
import qualified Control.AutoUpdate.Event as Event
import qualified Control.AutoUpdate.Thread as Thread

import GHC.Event

mkAutoUpdate :: UpdateSettings a -> IO (IO a)
mkAutoUpdate settings = do
mmgr <- getSystemEventManager
case mmgr of
Nothing -> Thread.mkAutoUpdate settings
Just _m -> Event.mkAutoUpdate settings

mkAutoUpdateWithModify :: UpdateSettings a -> (a -> IO a) -> IO (IO a)
mkAutoUpdateWithModify settings f = do
mmgr <- getSystemEventManager
case mmgr of
Nothing -> Thread.mkAutoUpdateWithModify settings f
Just _m -> Event.mkAutoUpdateWithModify settings f
#endif
import Control.AutoUpdate.Types
5 changes: 2 additions & 3 deletions auto-update/auto-update.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ library
Control.Reaper
Control.Reaper.Internal
other-modules: Control.AutoUpdate.Types
if os(windows)
other-modules: Control.AutoUpdate.Thread
else
Control.AutoUpdate.Thread
if !os(windows)
exposed-modules: Control.AutoUpdate.Internal
other-modules: Control.AutoUpdate.Event
build-depends: base >= 4.12 && < 5,
Expand Down
Loading