Skip to content

Commit

Permalink
Use AS::Mutex in ASCollectionElement (#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
maicki authored and Adlai-Holler committed Apr 5, 2019
1 parent a66f048 commit b9c8b32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/Details/ASCollectionElement.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import <AsyncDisplayKit/ASCollectionElement.h>
#import <AsyncDisplayKit/ASCellNode+Internal.h>
#import <mutex>
#import <AsyncDisplayKit/ASThread.h>

@interface ASCollectionElement ()

Expand All @@ -19,7 +19,7 @@ @interface ASCollectionElement ()
@end

@implementation ASCollectionElement {
std::mutex _lock;
AS::Mutex _lock;
ASCellNode *_node;
}

Expand All @@ -45,7 +45,7 @@ - (instancetype)initWithNodeModel:(id)nodeModel

- (ASCellNode *)node
{
std::lock_guard<std::mutex> l(_lock);
AS::MutexLocker l(_lock);
if (_nodeBlock != nil) {
ASCellNode *node = _nodeBlock();
_nodeBlock = nil;
Expand All @@ -64,7 +64,7 @@ - (ASCellNode *)node

- (ASCellNode *)nodeIfAllocated
{
std::lock_guard<std::mutex> l(_lock);
AS::MutexLocker l(_lock);
return _node;
}

Expand All @@ -73,7 +73,7 @@ - (void)setTraitCollection:(ASPrimitiveTraitCollection)traitCollection
ASCellNode *nodeIfNeedsPropagation;

{
std::lock_guard<std::mutex> l(_lock);
AS::MutexLocker l(_lock);
if (! ASPrimitiveTraitCollectionIsEqualToASPrimitiveTraitCollection(_traitCollection, traitCollection)) {
_traitCollection = traitCollection;
nodeIfNeedsPropagation = _node;
Expand Down

0 comments on commit b9c8b32

Please sign in to comment.