summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-17 00:01:24 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-17 00:05:28 -0700
commitf18b4a9767afe6603948fcb7750a24e386b5f0eb (patch)
treef74d59db88a2822b501d743cbc83713d2fdb8977
parent9ac1ef9e7cedfafadf03b3c9defb7a9e581d9553 (diff)
I need to @synchronize access to the StateCache.
-rw-r--r--MobileCydia.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 6555d3c..4b0fb36 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -2620,11 +2620,19 @@ struct PackageNameOrdering :
}
- (BOOL) hasMode {
+@synchronized (database_) {
+ if ([database_ era] != era_ || iterator_.end())
+ return nil;
+
pkgDepCache::StateCache &state([database_ cache][iterator_]);
return state.Mode != pkgDepCache::ModeKeep;
-}
+} }
- (NSString *) mode {
+@synchronized (database_) {
+ if ([database_ era] != era_ || iterator_.end())
+ return nil;
+
pkgDepCache::StateCache &state([database_ cache][iterator_]);
switch (state.Mode) {
@@ -2656,7 +2664,7 @@ struct PackageNameOrdering :
}
_nodefault
}
-}
+} }
- (NSString *) id {
return id_;