Flutter macOS Embedder
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 28 of file FlutterThreadSynchronizerTest.mm.

41  :(nonnull void (^)())task {
42  dispatch_async(_mainQueue, task);
43 }

Referenced by TEST().

◆ dispatchRenderTask:

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

Definition at line 28 of file FlutterThreadSynchronizerTest.mm.

45  :(nonnull void (^)())task {
46  dispatch_async(_renderQueue, task);
47 }
dispatch_queue_t _renderQueue

Referenced by TEST().

◆ init

- (nullable instancetype) init

Definition at line 28 of file FlutterThreadSynchronizerTest.mm.

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

◆ joinMain

- (void) joinMain

Definition at line 28 of file FlutterThreadSynchronizerTest.mm.

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

Referenced by TEST().

◆ joinRender

- (void) joinRender

Definition at line 28 of file FlutterThreadSynchronizerTest.mm.

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

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: