Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SNThreadSafeDictionary

Ju Liaoyuan edited this page Dec 20, 2022 · 1 revision

SNThreadSafeDictionary Class Reference

Inherits from NSMutableDictionary
Declared in SNThreadSafeDictionary.h

SNThreadSafeDictionary.m

Overview

A simple implementation of thread safe mutable dictionary.Generally, access performance is lower than NSMutableDictionary, but higher than using @synchronized, NSLock, or pthread_mutex_t.It’s also compatible with the custom methods in NSDictionary(YYAdd) and NSMutableDictionary(YYAdd)source code from YYKit

Warning: Fast enumerate(for...in) and enumerator is not thread safe, use enumerate using block instead. When enumerate or sort with block/callback, do NOT send message to the dictionary inside the block/callback.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /