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:
Tadeu Zagallo 2015-11-09 08:02:46 -08:00 коммит произвёл facebook-github-bot-3
Родитель 3c04bfcf53
Коммит fdbc1e03de
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -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];