Skip to content

Commit

Permalink
ship shared module queue (#44916)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #44916

Changelog: [Internal]

reached ship decision last year, getting rid of the gating here

Reviewed By: javache

Differential Revision: D58476997

fbshipit-source-id: 0ad52d29ac79b1751d6f10e67dc6886bf88e5ba4
  • Loading branch information
philIip authored and facebook-github-bot committed Jun 13, 2024
1 parent f7aea0c commit b19bf2b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
4 changes: 0 additions & 4 deletions packages/react-native/React/Base/RCTBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ void RCTEnableFabricInteropLayer(BOOL enabled);
BOOL RCTTurboModuleSyncVoidMethodsEnabled(void);
void RCTEnableTurboModuleSyncVoidMethods(BOOL enabled);

// Use a shared queue for executing module methods
BOOL RCTTurboModuleSharedQueueEnabled(void);
void RCTEnableTurboModuleSharedQueue(BOOL enabled);

BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain(void);
void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain(BOOL enabled);

Expand Down
12 changes: 0 additions & 12 deletions packages/react-native/React/Base/RCTBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,6 @@ void RCTEnableTurboModuleSyncVoidMethods(BOOL enabled)
gTurboModuleEnableSyncVoidMethods = enabled;
}

// Use a shared queue for executing module methods
static BOOL gTurboModuleEnableSharedQueue = NO;
BOOL RCTTurboModuleSharedQueueEnabled(void)
{
return gTurboModuleEnableSharedQueue;
}

void RCTEnableTurboModuleSharedQueue(BOOL enabled)
{
gTurboModuleEnableSharedQueue = enabled;
}

BOOL kDispatchAccessibilityManagerInitOntoMain = NO;
BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain(void)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ @implementation RCTTurboModuleManager {
RCTBridgeProxy *_bridgeProxy;
RCTBridgeModuleDecorator *_bridgeModuleDecorator;

BOOL _enableSharedModuleQueue;
dispatch_queue_t _sharedModuleQueue;
}

Expand All @@ -234,11 +233,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
_bridgeProxy = bridgeProxy;
_bridgeModuleDecorator = bridgeModuleDecorator;
_invalidating = false;
_enableSharedModuleQueue = RCTTurboModuleSharedQueueEnabled();

if (_enableSharedModuleQueue) {
_sharedModuleQueue = dispatch_queue_create("com.meta.react.turbomodulemanager.queue", DISPATCH_QUEUE_SERIAL);
}
_sharedModuleQueue = dispatch_queue_create("com.meta.react.turbomodulemanager.queue", DISPATCH_QUEUE_SERIAL);

if (RCTTurboModuleInteropEnabled()) {
// TODO(T174674274): Implement lazy loading of legacy modules in the new architecture.
Expand Down Expand Up @@ -728,12 +723,7 @@ - (BOOL)_shouldCreateObjCModule:(Class)moduleClass
* following if condition's block.
*/
if (!methodQueue) {
if (_enableSharedModuleQueue) {
methodQueue = _sharedModuleQueue;
} else {
NSString *methodQueueName = [NSString stringWithFormat:@"com.facebook.react.%sQueue", moduleName];
methodQueue = dispatch_queue_create(methodQueueName.UTF8String, DISPATCH_QUEUE_SERIAL);
}
methodQueue = _sharedModuleQueue;

if (moduleHasMethodQueueGetter) {
/**
Expand Down

0 comments on commit b19bf2b

Please sign in to comment.