@@ -76,6 +76,7 @@ module Streamly.Internal.Data.Stream.Channel.Types
7676 , stopWhen
7777 , ordered
7878 , interleaved
79+ , bound
7980
8081 , rate
8182 , avgRate
@@ -95,6 +96,7 @@ module Streamly.Internal.Data.Stream.Channel.Types
9596 , getStopWhen
9697 , getOrdered
9798 , getInterleaved
99+ , getBound
98100
99101 -- * Cleanup
100102 , cleanupSVar
@@ -340,6 +342,7 @@ data Config = Config
340342 , _stopWhen :: StopWhen
341343 , _ordered :: Bool
342344 , _interleaved :: Bool
345+ , _bound :: Bool
343346 }
344347
345348-------------------------------------------------------------------------------
@@ -374,6 +377,7 @@ defaultConfig = Config
374377 , _stopWhen = AllStop
375378 , _ordered = False
376379 , _interleaved = False
380+ , _bound = False
377381 }
378382
379383-------------------------------------------------------------------------------
@@ -542,6 +546,14 @@ interleaved flag st = st { _interleaved = flag }
542546getInterleaved :: Config -> Bool
543547getInterleaved = _interleaved
544548
549+-- | Spawn bound threads (i.e., spawn threads using 'forkOS' instead of
550+-- 'forkIO'). The default value is 'False'.
551+bound :: Bool -> Config -> Config
552+bound flag st = st { _bound = flag }
553+
554+getBound :: Config -> Bool
555+getBound = _bound
556+
545557-------------------------------------------------------------------------------
546558-- Initialization
547559-------------------------------------------------------------------------------