Flutter macOS Embedder
FlutterThreadSynchronizerTestScaffold Class Reference
Inheritance diagram for FlutterThreadSynchronizerTestScaffold:

Instance Methods

(nullable instancetype) - init
 
(void) - dispatchMainTask:
 
(void) - dispatchRenderTask:
 
(void) - joinMain
 
(void) - joinRender
 

Properties

FlutterThreadSynchronizersynchronizer
 

Detailed Description

Definition at line 10 of file FlutterThreadSynchronizerTest.mm.

Method Documentation

◆ dispatchMainTask:

- (void) dispatchMainTask: (nonnull void(^)())  task

Definition at line 43 of file FlutterThreadSynchronizerTest.mm.

43  :(nonnull void (^)())task {
44  dispatch_async(_mainQueue, task);
45 }

Referenced by TEST().

◆ dispatchRenderTask:

- (void) dispatchRenderTask: (nonnull void(^)())  task

Definition at line 47 of file FlutterThreadSynchronizerTest.mm.

47  :(nonnull void (^)())task {
48  dispatch_async(_renderQueue, task);
49 }

References _renderQueue.

Referenced by TEST().

◆ init

- (nullable instancetype) init

Definition at line 33 of file FlutterThreadSynchronizerTest.mm.

33  {
34  self = [super init];
35  if (self != nil) {
36  _mainQueue = dispatch_queue_create("MAIN", DISPATCH_QUEUE_SERIAL);
37  _renderQueue = dispatch_queue_create("RENDER", DISPATCH_QUEUE_SERIAL);
38  _synchronizer = [[FlutterThreadSynchronizer alloc] initWithMainQueue:_mainQueue];
39  }
40  return self;
41 }

References _renderQueue, and _synchronizer.

◆ joinMain

- (void) joinMain

Definition at line 51 of file FlutterThreadSynchronizerTest.mm.

51  {
52  fml::AutoResetWaitableEvent latch;
53  fml::AutoResetWaitableEvent* pLatch = &latch;
54  dispatch_async(_mainQueue, ^{
55  pLatch->Signal();
56  });
57  latch.Wait();
58 }

Referenced by TEST().

◆ joinRender

- (void) joinRender

Definition at line 60 of file FlutterThreadSynchronizerTest.mm.

60  {
61  fml::AutoResetWaitableEvent latch;
62  fml::AutoResetWaitableEvent* pLatch = &latch;
63  dispatch_async(_renderQueue, ^{
64  pLatch->Signal();
65  });
66  latch.Wait();
67 }

References _renderQueue.

Referenced by TEST().

Property Documentation

◆ synchronizer

- (FlutterThreadSynchronizer*) synchronizer
readnonatomicassign

Definition at line 12 of file FlutterThreadSynchronizerTest.mm.

Referenced by TEST().


The documentation for this class was generated from the following file:
FlutterThreadSynchronizer
Definition: FlutterThreadSynchronizer.h:16
_synchronizer
FlutterThreadSynchronizer * _synchronizer
Definition: FlutterThreadSynchronizerTest.mm:28
_renderQueue
dispatch_queue_t _renderQueue
Definition: FlutterThreadSynchronizerTest.mm:25