|
Muvicado HD
|
MutLockDict is a thread-safe version of NSMutableDictionary. More...
#include <MutLockDict.h>


Instance Methods | |
| (id) | - initWithCapacity: |
| (void) | - rdlock |
| (void) | - wrlock |
| (void) | - unlock |
| (NSMutableDictionary *) | - dict |
| (NSMutableDictionary *) | - createDictCopy |
| (NSMutableDictionary *) | - lockCreateDictCopy |
| (void) | - setObject:forKey: |
| (void) | - lockSetObject:forKey: |
| (void) | - setValue:forKey: |
| (void) | - lockSetValue:forKey: |
| (void) | - removeAllObjects |
| (void) | - lockRemoveAllObjects |
| (id) | - objectForKey: |
| (id) | - lockObjectForKey: |
| (void) | - removeObjectForKey: |
| (void) | - lockRemoveObjectForKey: |
| (void) | - addEntriesFromDictionary: |
| (void) | - lockAddEntriesFromDictionary: |
| (NSArray *) | - allKeys |
| (NSArray *) | - lockAllKeys |
| (NSArray *) | - allValues |
| (NSArray *) | - lockAllValues |
| (NSUInteger) | - count |
| (NSUInteger) | - lockCount |
Class Methods | |
| (id) | + dictionaryWithCapacity: |
Protected Attributes | |
| NSMutableDictionary * | dict |
| pthread_rwlock_t | dictLock |
MutLockDict is a thread-safe version of NSMutableDictionary.
This class exists because NSMutableDictionary is not thread-safe by default: if you call methods on it from two different threads at the same time, it will try to execute both, often crashing in the process. This class has methods which allow you to work with a mutable dictionary in a transparent and thread-safe manner.
Definition at line 16 of file MutLockDict.h.
| - (void) addEntriesFromDictionary: | (NSDictionary *) | otherDictionary |
| - (NSArray *) allKeys |


| - (NSArray *) allValues |
Implemented in MutNRLockDict.


| - (NSUInteger) count |


| - (NSMutableDictionary *) createDictCopy |


| - (NSMutableDictionary *) dict |
| + (id) dictionaryWithCapacity: | (NSUInteger) | c |
| - (id) initWithCapacity: | (NSUInteger) | c |
| - (void) lockAddEntriesFromDictionary: | (NSDictionary *) | otherDictionary |
| - (NSArray *) lockAllKeys |


| - (NSArray *) lockAllValues |


| - (NSUInteger) lockCount |


| - (NSMutableDictionary *) lockCreateDictCopy |


| - (id) lockObjectForKey: | (NSString *) | k |
| - (void) lockRemoveAllObjects |


| - (void) lockRemoveObjectForKey: | (NSString *) | k |
| - (void) lockSetObject: | (id) | o | |
| forKey: | (NSString *) | s |
| - (void) lockSetValue: | (id) | v | |
| forKey: | (NSString *) | s |
| - (id) objectForKey: | (NSString *) | k |
Implemented in MutNRLockDict.
| - (void) rdlock |


| - (void) removeAllObjects |


| - (void) removeObjectForKey: | (NSString *) | k |
| - (void) setObject: | (id) | o | |
| forKey: | (NSString *) | s |
Implemented in MutNRLockDict.
| - (void) setValue: | (id) | v | |
| forKey: | (NSString *) | s |
Implemented in MutNRLockDict.
| - (void) unlock |


| - (void) wrlock |


|
protected |
Definition at line 17 of file MutLockDict.h.
|
protected |
Definition at line 18 of file MutLockDict.h.