Skip to content
Snippets Groups Projects
Commit 49b7f834 authored by Muxi Yan's avatar Muxi Yan
Browse files

Remove synchronization in GRXBufferedPipe:writesFinishedWithError and change tests correspondingly

parent ec8e8250
No related branches found
No related tags found
No related merge requests found
...@@ -82,11 +82,6 @@ ...@@ -82,11 +82,6 @@
if (errorOrNil) { if (errorOrNil) {
// No need to write pending values. // No need to write pending values.
[self finishWithError:_errorOrNil]; [self finishWithError:_errorOrNil];
} else {
// Wait until all the pending writes to be finished.
dispatch_sync(_writeQueue, ^{
return;
});
} }
} }
......
...@@ -166,6 +166,9 @@ ...@@ -166,6 +166,9 @@
[pipe writeValue:anyValue]; [pipe writeValue:anyValue];
[pipe writesFinishedWithError:nil]; [pipe writesFinishedWithError:nil];
// Wait buffered pipe to be flushed.
sleep(1);
// Then: // Then:
XCTAssertEqual(handler.timesCalled, 1); XCTAssertEqual(handler.timesCalled, 1);
XCTAssertEqualObjects(handler.value, anyValue); XCTAssertEqualObjects(handler.value, anyValue);
...@@ -202,6 +205,7 @@ ...@@ -202,6 +205,7 @@
[pipe writesFinishedWithError:nil]; [pipe writesFinishedWithError:nil];
// then start the writeable // then start the writeable
[pipe startWithWriteable:writeable]; [pipe startWithWriteable:writeable];
sleep(1);
// Then: // Then:
XCTAssertEqual(handler.timesCalled, 1); XCTAssertEqual(handler.timesCalled, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment