@@ -100,13 +100,13 @@ module internal InternalStreams =
100
100
let asyncResult = ref null
101
101
Async.FromBeginEnd(
102
102
( fun ( callback , state ) ->
103
- asyncResult := beginAction( callback, state)
104
- ! asyncResult),
103
+ asyncResult.Value <- beginAction( callback, state)
104
+ asyncResult.Value ),
105
105
( fun res ->
106
106
endAction res),
107
107
cancelAction = ( fun () ->
108
- while ! asyncResult = null do Thread.Sleep 20
109
- cancelAction(! asyncResult)))
108
+ while asyncResult.Value = null do Thread.Sleep 20
109
+ cancelAction( asyncResult.Value )))
110
110
open AsyncHelper
111
111
112
112
type ConcurrentQueueMessage < 'a > =
@@ -232,12 +232,12 @@ module internal InternalStreams =
232
232
while not cts.IsCancellationRequested do
233
233
let! data = innerStream.Read()
234
234
let finished = ref false
235
- while not ! finished do
235
+ while not finished.Value do
236
236
let! ( asyncResult : MyIAsyncReadResult < 'a >) = queue.DequeAsync()
237
237
if not asyncResult.IsCanceled then
238
238
try
239
239
asyncResult.End( data)
240
- finished := true
240
+ finished.Value <- true
241
241
with ReadCanceledException -> () // find next
242
242
return ()
243
243
}, cancellationToken = workerCts.Token)
@@ -466,7 +466,7 @@ module internal InternalStreams =
466
466
//let raw = infiniteStream()
467
467
let readFinished = ref false
468
468
let read () =
469
- if ! readFinished then
469
+ if readFinished.Value then
470
470
async.Return None
471
471
else
472
472
async {
@@ -477,16 +477,16 @@ module internal InternalStreams =
477
477
match s with
478
478
| Some d -> Some d
479
479
| None ->
480
- readFinished := true
480
+ readFinished.Value <- true
481
481
None
482
482
| None ->
483
483
failwith " stream should not be limited as we are using an infiniteStream!" }
484
484
let isFinished = ref false
485
485
let finish () = async {
486
486
do ! raw.Write None
487
- isFinished := true }
487
+ isFinished.Value <- true }
488
488
let write item =
489
- if ! isFinished then
489
+ if isFinished.Value then
490
490
failwith " stream is in finished state so it should not be written to!"
491
491
raw.Write ( Some item)
492
492
finish,
0 commit comments