mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
Use barrier to write flag
Summary: public Use OSAtomicBarrier to write the flags rather than using OSAtomic to read *and* write. Reviewed By: jspahrsummers Differential Revision: D2625915 fb-gh-sync-id: 2ed357ae408b2afe5ef2689582585bf4f9edd8a7
This commit is contained in:
parent
3c04bfcf53
commit
fdbc1e03de
@ -282,14 +282,18 @@ dispatch_queue_t RCTProfileGetQueue(void)
|
||||
|
||||
BOOL RCTProfileIsProfiling(void)
|
||||
{
|
||||
return (BOOL)OSAtomicAnd32(1, &RCTProfileProfiling);
|
||||
return (BOOL)RCTProfileProfiling;
|
||||
}
|
||||
|
||||
void RCTProfileInit(RCTBridge *bridge)
|
||||
{
|
||||
// TODO: enable assert JS thread from any file (and assert here)
|
||||
|
||||
OSAtomicOr32(1, &RCTProfileProfiling);
|
||||
if (RCTProfileIsProfiling()) {
|
||||
return;
|
||||
}
|
||||
|
||||
OSAtomicOr32Barrier(1, &RCTProfileProfiling);
|
||||
|
||||
if (callbacks != NULL) {
|
||||
size_t buffer_size = 1 << 22;
|
||||
@ -321,7 +325,7 @@ void RCTProfileEnd(RCTBridge *bridge, void (^callback)(NSString *))
|
||||
return;
|
||||
}
|
||||
|
||||
OSAtomicAnd32(0, &RCTProfileProfiling);
|
||||
OSAtomicAnd32Barrier(0, &RCTProfileProfiling);
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTProfileDidEndProfiling
|
||||
object:nil];
|
||||
|
Loading…
x
Reference in New Issue
Block a user