Skip to content

refactor(Worklets): remove supportsLocking parameter from Worklet Runtimes #7904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 29, 2025

Conversation

tjzel
Copy link
Collaborator

@tjzel tjzel commented Jul 25, 2025

Summary

We already set it to true all the time.

Test plan

CI

@tjzel tjzel requested a review from piaskowyk July 25, 2025 14:03
@tjzel tjzel requested a review from Copilot July 25, 2025 14:03
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This refactoring removes the supportsLocking parameter from WorkletRuntime constructors and related functions, as it was always set to true. The change simplifies the codebase by eliminating a redundant parameter and associated conditional logic.

  • Removed supportsLocking parameter from WorkletRuntime constructor and related functions
  • Eliminated conditional logic that checked the supportsLocking flag
  • Cleaned up unused constants and assertions related to locking support

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
WorkletRuntime.h Removed supportsLocking parameter from constructor and cleaned up member variables
WorkletRuntime.cpp Simplified constructor and makeRuntime function by removing locking conditionals
RuntimeManager.h Removed supportsLocking parameter from createWorkletRuntime method
RuntimeManager.cpp Updated runtime creation calls to remove the hardcoded true parameter
JSIWorkletsModuleProxy.cpp Removed supportsLocking parameter from createWorkletRuntime call
Comments suppressed due to low confidence (1)

packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp:53

  • The removal of the null check for queue_ before calling push could cause a segmentation fault if queue_ is null. The lazy initialization logic was removed but queue_ is never initialized in the constructor.
};

@tjzel tjzel changed the base branch from main to @tjzel/worklets/runtime-data July 25, 2025 14:09
Base automatically changed from @tjzel/worklets/runtime-data to main July 29, 2025 14:02
@tjzel tjzel added this pull request to the merge queue Jul 29, 2025
Merged via the queue into main with commit a89f1c3 Jul 29, 2025
17 checks passed
@tjzel tjzel deleted the @tjzel/worklets/runtime-lock branch July 29, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants