Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oderwat committed Apr 15, 2019
1 parent a6fbdb7 commit ac16419
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 965 deletions.
7 changes: 4 additions & 3 deletions Data/TCache.hs
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ data CheckTPVarFlags= AddToHash | NoAddToHash
setCache :: Cache -> IO()
setCache ref = readIORef ref >>= \ch -> writeIORef refcache ch

-- | The cache holder. stablished by default
-- | The cache holder. established by default
refcache :: Cache
{-# NOINLINE refcache #-}
refcache =unsafePerformIO $ newCache >>= newIORef

-- | Creates a new cache. Experimental
Expand Down Expand Up @@ -712,7 +713,7 @@ getResource r= do{mr<- getResources [r];return $! head mr}
{-# INLINE getResources #-}
getResources:: (IResource a, Typeable a)=>[a]-> IO [Maybe a]
getResources rs= atomically $ withSTMResources rs f1 where
f1 mrs= Resources [] [] mrs
f1 = Resources [] []


-- | Delete the resource from cache and from persistent storage.
Expand Down Expand Up @@ -746,7 +747,7 @@ takeDBRef cache flags x =do
case mr of
Just dbref -> return . Just $! castErr dbref
Nothing -> unsafeIOToSTM (finalize w) >> takeDBRef cache flags x
Nothing -> do
Nothing ->
safeIOToSTM $ readToCache flags cache keyr
-- unsafeIOToSTM $ readResourceByKey keyr

Expand Down
Loading

0 comments on commit ac16419

Please sign in to comment.