File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ open class Operation : NSObject {
347
347
_state = . executing
348
348
Operation . observeValue ( forKeyPath: _NSOperationIsExecuting, ofObject: self )
349
349
350
- _queue? . _execute ( self )
350
+ _queue? . _execute ( self ) ?? main ( )
351
351
}
352
352
353
353
if __NSOperationState. executing == _state {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class TestOperationQueue : XCTestCase {
15
15
( " test_OperationPriorities " , test_OperationPriorities) ,
16
16
( " test_OperationCount " , test_OperationCount) ,
17
17
( " test_AsyncOperation " , test_AsyncOperation) ,
18
- ( " test_SyncOperation " , test_SyncOperation ) ,
18
+ ( " test_SyncOperationWithoutAQueue " , test_SyncOperationWithoutAQueue ) ,
19
19
( " test_isExecutingWorks " , test_isExecutingWorks) ,
20
20
( " test_MainQueueGetter " , test_MainQueueGetter) ,
21
21
( " test_CancelOneOperation " , test_CancelOneOperation) ,
@@ -106,7 +106,7 @@ class TestOperationQueue : XCTestCase {
106
106
XCTAssertTrue ( operation. isFinished)
107
107
}
108
108
109
- func test_SyncOperation ( ) {
109
+ func test_SyncOperationWithoutAQueue ( ) {
110
110
let operation = SyncOperation ( )
111
111
XCTAssertFalse ( operation. isExecuting)
112
112
XCTAssertFalse ( operation. isFinished)
You can’t perform that action at this time.
0 commit comments