diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-09-09 15:49:44 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-09-09 15:51:34 -0400 |
commit | d1f722e3b0b74a9d9a2e35ac1f47dbca9f7cf606 (patch) | |
tree | 74314a3747d4a0456135bf38b2e1115b5a3f64b9 /Types | |
parent | 2408f5c6084aa04a09b36edcd264ce6bc7177c93 (diff) |
better locking for json with -J
Avoid threads emitting json at the same time and scrambling, which was
still possible even with the buffering, just less likely.
Converted json IO actions to JSONChunk data too.
Diffstat (limited to 'Types')
-rw-r--r-- | Types/Messages.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Types/Messages.hs b/Types/Messages.hs index a155cae2a..49242ea45 100644 --- a/Types/Messages.hs +++ b/Types/Messages.hs @@ -10,6 +10,7 @@ module Types.Messages where import Data.Default +import qualified Data.ByteString.Lazy as B #ifdef WITH_CONCURRENTOUTPUT import System.Console.Regions (ConsoleRegion) @@ -30,7 +31,7 @@ data MessageState = MessageState , consoleRegion :: Maybe ConsoleRegion , consoleRegionErrFlag :: Bool #endif - , jsonBuffer :: [IO ()] + , jsonBuffer :: B.ByteString } instance Default MessageState @@ -44,5 +45,5 @@ instance Default MessageState , consoleRegion = Nothing , consoleRegionErrFlag = False #endif - , jsonBuffer = [] + , jsonBuffer = B.empty } |