diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2009-06-17 21:57:49 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:13:16 +0000 |
commit | 28ce87049dc989a01a744f877317cdd39be56597 (patch) | |
tree | 5bd51c020c6a94b37bd901452e170de413fa9104 /Cydia.mm | |
parent | a95e0405841b00b6fb27e5b921d8a77e7d41d9fc (diff) |
Epic multi-threading.
Diffstat (limited to 'Cydia.mm')
-rw-r--r-- | Cydia.mm | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -2178,6 +2178,7 @@ struct PackageNameOrdering : } + (Package *) packageWithIterator:(pkgCache::PkgIterator)iterator withZone:(NSZone *)zone inPool:(apr_pool_t *)pool database:(Database *)database { +@synchronized ([Database class]) { pkgCache::VerIterator version; _profile(Package$packageWithIterator$GetCandidateVer) @@ -2193,7 +2194,7 @@ struct PackageNameOrdering : inPool:pool database:database ] autorelease]; -} +} } - (pkgCache::PkgIterator) iterator { return iterator_; @@ -2981,11 +2982,12 @@ static NSArray *Finishes_; } - (Package *) packageWithName:(NSString *)name { +@synchronized ([Database class]) { if (static_cast<pkgDepCache *>(cache_) == NULL) return nil; pkgCache::PkgIterator iterator(cache_->FindPkg([name UTF8String])); return iterator.end() ? nil : [Package packageWithIterator:iterator withZone:NULL inPool:pool_ database:self]; -} +} } - (Database *) init { if ((self = [super init]) != nil) { @@ -3141,6 +3143,8 @@ static NSArray *Finishes_; } - (void) reloadData { _pooled +@synchronized ([Database class]) { + @synchronized (self) { ++era_; } @@ -3279,7 +3283,7 @@ static NSArray *Finishes_; _trace(); } -} +} } - (void) configure { NSString *dpkg = [NSString stringWithFormat:@"dpkg --configure -a --status-fd %u", statusfd_]; @@ -6566,9 +6570,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { section = [filtered_ objectAtIndex:(row - 1)]; name = [section name]; - if (name != nil) + if (name != nil) { + name = [NSString stringWithString:name]; title = [[NSBundle mainBundle] localizedStringForKey:Simplify(name) value:nil table:@"Sections"]; - else { + } else { name = @""; title = UCLocalize("NO_SECTION"); } |