mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove flag enable_blocking_queues_for_animated
Summary: changelog: [internal] jest_e2e[run_all_tests] Reviewed By: mdvacca Differential Revision: D40340959 fbshipit-source-id: dc1250de7cd6107eab18b3705ec2d5b5a46fa9ad
This commit is contained in:
committed by
Facebook GitHub Bot
parent
90192377f5
commit
b5a40fb4f4
@@ -25,7 +25,6 @@ import com.facebook.react.bridge.UIManager;
|
||||
import com.facebook.react.bridge.UIManagerListener;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.config.ReactFeatureFlags;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
||||
import com.facebook.react.modules.core.ReactChoreographer;
|
||||
@@ -154,38 +153,21 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
private class ConcurrentOperationQueue {
|
||||
private final Queue<UIThreadOperation> mQueue = new ConcurrentLinkedQueue<>();
|
||||
@Nullable private UIThreadOperation mPeekedOperation = null;
|
||||
private boolean mSynchronizedAccess = false;
|
||||
|
||||
@AnyThread
|
||||
boolean isEmpty() {
|
||||
return mQueue.isEmpty() && mPeekedOperation == null;
|
||||
}
|
||||
|
||||
void setSynchronizedAccess(boolean isSynchronizedAccess) {
|
||||
mSynchronizedAccess = isSynchronizedAccess;
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
void add(UIThreadOperation operation) {
|
||||
if (mSynchronizedAccess) {
|
||||
synchronized (this) {
|
||||
mQueue.add(operation);
|
||||
}
|
||||
} else {
|
||||
mQueue.add(operation);
|
||||
}
|
||||
mQueue.add(operation);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
void executeBatch(long maxBatchNumber, NativeAnimatedNodesManager nodesManager) {
|
||||
List<UIThreadOperation> operations;
|
||||
if (mSynchronizedAccess) {
|
||||
synchronized (this) {
|
||||
operations = drainQueueIntoList(maxBatchNumber);
|
||||
}
|
||||
} else {
|
||||
operations = drainQueueIntoList(maxBatchNumber);
|
||||
}
|
||||
operations = drainQueueIntoList(maxBatchNumber);
|
||||
if (operations != null) {
|
||||
for (UIThreadOperation operation : operations) {
|
||||
operation.execute(nodesManager);
|
||||
@@ -280,10 +262,6 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// If shipping this flag, make sure to migrate to non-concurrent queue for efficiency
|
||||
mOperations.setSynchronizedAccess(ReactFeatureFlags.enableSynchronizationForAnimated);
|
||||
mPreOperations.setSynchronizedAccess(ReactFeatureFlags.enableSynchronizationForAnimated);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -73,9 +73,6 @@ public class ReactFeatureFlags {
|
||||
/** Feature flag to configure eager attachment of the root view/initialisation of the JS code */
|
||||
public static boolean enableEagerRootViewAttachment = false;
|
||||
|
||||
/** Feature flag to configure synchronized queue access for Animated module */
|
||||
public static boolean enableSynchronizationForAnimated = false;
|
||||
|
||||
/** Enables or disables MapBuffer Serialization */
|
||||
public static boolean mapBufferSerializationEnabled = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user