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

Method Documentation

◆ dispatchMainTask:

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

Definition at line 49 of file FlutterThreadSynchronizerTest.mm.

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

Referenced by TEST().

◆ dispatchRenderTask:

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

Definition at line 53 of file FlutterThreadSynchronizerTest.mm.

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

References _renderQueue.

Referenced by TEST().

◆ init

- (nullable instancetype) init

Definition at line 39 of file FlutterThreadSynchronizerTest.mm.

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

References _renderQueue, and _synchronizer.

◆ joinMain

- (void) joinMain

Definition at line 57 of file FlutterThreadSynchronizerTest.mm.

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

Referenced by TEST().

◆ joinRender

- (void) joinRender

Definition at line 66 of file FlutterThreadSynchronizerTest.mm.

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

References _renderQueue.

Referenced by TEST().

Property Documentation

◆ synchronizer

- (FlutterThreadSynchronizer*) synchronizer
readnonatomicassign

Definition at line 18 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:34
_renderQueue
dispatch_queue_t _renderQueue
Definition: FlutterThreadSynchronizerTest.mm:31