Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Add locking around setting weakCacheEntry ivar#2812

Merged
Adlai-Holler merged 1 commit intofacebookarchive:masterfrom
chrisdanford:fix_weak_cache_entry_locking
Dec 21, 2016
Merged

Add locking around setting weakCacheEntry ivar#2812
Adlai-Holler merged 1 commit intofacebookarchive:masterfrom
chrisdanford:fix_weak_cache_entry_locking

Conversation

@chrisdanford
Copy link
Copy Markdown
Contributor

Pointed out by @nguyenhuy. There was no locking around this non-atomic ivar.

Comment thread AsyncDisplayKit/ASImageNode.mm Outdated

_weakCacheEntry = nil; // release contents from the cache.
__instanceLock__.lock();
_weakCacheEntry = entry; // Retain so that the entry remains in the weak cache
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be set to nil?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@chrisdanford chrisdanford force-pushed the fix_weak_cache_entry_locking branch 3 times, most recently from 7287cf2 to 9edbed1 Compare December 20, 2016 22:33
@chrisdanford chrisdanford force-pushed the fix_weak_cache_entry_locking branch from 9edbed1 to 42879dd Compare December 20, 2016 22:34

- (void)clearContents
{
[super clearContents];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the indentation as well!

@Adlai-Holler
Copy link
Copy Markdown
Contributor

Nice @chrisdanford! Safety dance! It seems like the CI failure is flaky – opened #2818. Jenkins test this please

@Adlai-Holler Adlai-Holler merged commit ecef8ed into facebookarchive:master Dec 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants