Skip to content

Commit

Permalink
Avoid an unnecessary lock & unlock pair in ASMainSerialQueue (Texture…
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuy authored and hebertialmeida committed May 10, 2019
1 parent 45d9050 commit 602a1b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Source/Details/ASMainSerialQueue.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ - (NSUInteger)numberOfScheduledBlocks

- (void)performBlockOnMainThread:(dispatch_block_t)block
{

AS::UniqueLock l(_serialQueueLock);
[_blocks addObject:block];
{
l.unlock();
[self runBlocks];
l.lock();
AS::MutexLocker l(_serialQueueLock);
[_blocks addObject:block];
}

[self runBlocks];
}

- (void)runBlocks
Expand Down

0 comments on commit 602a1b2

Please sign in to comment.