[Job Queue] Prevent multiple jobs from stacking
Jobs are meant to be serialized, so prevent multiple jobs from queueing simultaneously, as they are not designed to interact with each other. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
92573ec088
commit
5bca70d141
|
@ -219,6 +219,9 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
|
|||
}
|
||||
|
||||
- (void)beginProgress:(NSString *)localizedDescription {
|
||||
while(playbackController.progressOverall) {
|
||||
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]];
|
||||
}
|
||||
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
|
||||
self->playbackController.progressOverall = [NSProgress progressWithTotalUnitCount:100000];
|
||||
self->playbackController.progressOverall.localizedDescription = localizedDescription;
|
||||
|
|
|
@ -262,6 +262,9 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
|
|||
}
|
||||
|
||||
- (void)beginProgress:(NSString *)localizedDescription {
|
||||
while(playbackController.progressOverall) {
|
||||
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]];
|
||||
}
|
||||
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
|
||||
self->playbackController.progressOverall = [NSProgress progressWithTotalUnitCount:100000];
|
||||
self->playbackController.progressOverall.localizedDescription = localizedDescription;
|
||||
|
|
Loading…
Reference in New Issue