|
@@ -193,7 +193,9 @@
|
|
|
// [self.arr_queue_lock unlock];
|
|
// [self.arr_queue_lock unlock];
|
|
|
|
|
|
|
|
@synchronized(self) {
|
|
@synchronized(self) {
|
|
|
- [[self mutableArrayValueForKey:@"arr_queue"] addObject:task];
|
|
|
|
|
|
|
+// [[self mutableArrayValueForKey:@"arr_queue"] addObject:task];
|
|
|
|
|
+
|
|
|
|
|
+ [[self mutableArrayValueForKey:@"arr_queue"] insertObject:task atIndex:0];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(self.newtaskStatus==TaskStatusWait)
|
|
if(self.newtaskStatus==TaskStatusWait)
|
|
@@ -216,7 +218,9 @@
|
|
|
// [[self mutableArrayValueForKey:@"arr_queue"] addObjectsFromArray:tasks];
|
|
// [[self mutableArrayValueForKey:@"arr_queue"] addObjectsFromArray:tasks];
|
|
|
|
|
|
|
|
|
|
|
|
|
- NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange([self mutableArrayValueForKey:@"arr_queue"].count,tasks.count )];
|
|
|
|
|
|
|
+// NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange([self mutableArrayValueForKey:@"arr_queue"].count,tasks.count )];
|
|
|
|
|
+
|
|
|
|
|
+ NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0,tasks.count )];
|
|
|
[[self mutableArrayValueForKey:@"arr_queue"] insertObjects:tasks atIndexes:indexSet];
|
|
[[self mutableArrayValueForKey:@"arr_queue"] insertObjects:tasks atIndexes:indexSet];
|
|
|
}
|
|
}
|
|
|
|
|
|