diff options
author | Muxi Yan <mxyan@google.com> | 2017-06-05 09:22:15 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-06-05 09:22:15 -0700 |
commit | d6545bb3df44ee3543fa5209bb3d2da3061848cd (patch) | |
tree | 2aae7326dac50e8db310f0b777da411d5c9567ef /src | |
parent | 033db460bab9276e8c775d4eff7853160ab23b12 (diff) |
Comments on BufferedPipe
Diffstat (limited to 'src')
-rw-r--r-- | src/objective-c/RxLibrary/GRXBufferedPipe.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/objective-c/RxLibrary/GRXBufferedPipe.m b/src/objective-c/RxLibrary/GRXBufferedPipe.m index 90d51163dd..154d164f69 100644 --- a/src/objective-c/RxLibrary/GRXBufferedPipe.m +++ b/src/objective-c/RxLibrary/GRXBufferedPipe.m @@ -33,10 +33,13 @@ #import "GRXBufferedPipe.h" +@interface GRXBufferedPipe () +@property(atomic) NSError *errorOrNil; +@end + @implementation GRXBufferedPipe { id<GRXWriteable> _writeable; BOOL _inputIsFinished; - NSError *_errorOrNil; dispatch_queue_t _writeQueue; } @@ -90,7 +93,7 @@ dispatch_async(_writeQueue, ^{ GRXBufferedPipe *strongSelf = weakSelf; if (strongSelf) { - [strongSelf finishWithError:_errorOrNil]; + [strongSelf finishWithError:nil]; } }); } @@ -123,7 +126,7 @@ return; case GRXWriterStateStarted: if (_state == GRXWriterStatePaused) { - _state = newState; + _state = newState; dispatch_resume(_writeQueue); } return; @@ -134,9 +137,6 @@ } - (void)startWithWriteable:(id<GRXWriteable>)writeable { - if (_state != GRXWriterStateNotStarted) { - return; - } _state = GRXWriterStateStarted; _writeable = writeable; dispatch_resume(_writeQueue); |