projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the dynamic linker thread-safe.
[ghc-hetmet.git]
/
compiler
/
utils
/
Util.lhs
diff --git
a/compiler/utils/Util.lhs
b/compiler/utils/Util.lhs
index
3de52b6
..
5cf020f
100644
(file)
--- a/
compiler/utils/Util.lhs
+++ b/
compiler/utils/Util.lhs
@@
-65,7
+65,7
@@
module Util (
doesDirNameExist,
modificationTimeIfExists,
doesDirNameExist,
modificationTimeIfExists,
- global, consIORef,
+ global, consIORef, globalMVar, globalEmptyMVar,
-- * Filenames and paths
Suffix,
-- * Filenames and paths
Suffix,
@@
-83,6
+83,7
@@
import Data.IORef ( IORef, newIORef )
import System.IO.Unsafe ( unsafePerformIO )
import Data.IORef ( readIORef, writeIORef )
import Data.List hiding (group)
import System.IO.Unsafe ( unsafePerformIO )
import Data.IORef ( readIORef, writeIORef )
import Data.List hiding (group)
+import Control.Concurrent.MVar ( MVar, newMVar, newEmptyMVar )
#ifdef DEBUG
import qualified Data.List as List ( elem, notElem )
#ifdef DEBUG
import qualified Data.List as List ( elem, notElem )
@@
-699,6
+700,14
@@
consIORef var x = do
writeIORef var (x:xs)
\end{code}
writeIORef var (x:xs)
\end{code}
+\begin{code}
+globalMVar :: a -> MVar a
+globalMVar a = unsafePerformIO (newMVar a)
+
+globalEmptyMVar :: MVar a
+globalEmptyMVar = unsafePerformIO newEmptyMVar
+\end{code}
+
Module names:
\begin{code}
Module names:
\begin{code}