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 17 of file FlutterThreadSynchronizerTest.mm.

Method Documentation

◆ dispatchMainTask:

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

Definition at line 50 of file FlutterThreadSynchronizerTest.mm.

50  :(nonnull void (^)())task {
51  dispatch_async(_mainQueue, task);
52 }

Referenced by TEST().

◆ dispatchRenderTask:

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

Definition at line 54 of file FlutterThreadSynchronizerTest.mm.

54  :(nonnull void (^)())task {
55  dispatch_async(_renderQueue, task);
56 }

References _renderQueue.

Referenced by TEST().

◆ init

- (nullable instancetype) init

Definition at line 40 of file FlutterThreadSynchronizerTest.mm.

40  {
41  self = [super init];
42  if (self != nil) {
43  _mainQueue = dispatch_queue_create("MAIN", DISPATCH_QUEUE_SERIAL);
44  _renderQueue = dispatch_queue_create("RENDER", DISPATCH_QUEUE_SERIAL);
45  _synchronizer = [[FlutterThreadSynchronizer alloc] initWithMainQueue:_mainQueue];
46  }
47  return self;
48 }

References _renderQueue, and _synchronizer.

◆ joinMain

- (void) joinMain

Definition at line 58 of file FlutterThreadSynchronizerTest.mm.

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

Referenced by TEST().

◆ joinRender

- (void) joinRender

Definition at line 67 of file FlutterThreadSynchronizerTest.mm.

67  {
68  fml::AutoResetWaitableEvent latch;
69  fml::AutoResetWaitableEvent* pLatch = &latch;
70  dispatch_async(_renderQueue, ^{
71  pLatch->Signal();
72  });
73  latch.Wait();
74 }

References _renderQueue.

Referenced by TEST().

Property Documentation

◆ synchronizer

- (FlutterThreadSynchronizer*) synchronizer
readnonatomicassign

Definition at line 19 of file FlutterThreadSynchronizerTest.mm.

Referenced by TEST().


The documentation for this class was generated from the following file:
FlutterThreadSynchronizer
Definition: FlutterThreadSynchronizer.h:13
_synchronizer
FlutterThreadSynchronizer * _synchronizer
Definition: FlutterThreadSynchronizerTest.mm:35
_renderQueue
dispatch_queue_t _renderQueue
Definition: FlutterThreadSynchronizerTest.mm:32