-
Notifications
You must be signed in to change notification settings - Fork 14
/
Queue.h
52 lines (36 loc) · 1017 Bytes
/
Queue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// Queue.h
// TaskExplorer
//
// Created by Patrick Wardle on 9/26/14.
// Copyright (c) 2014 Objective-See. All rights reserved.
//
//from: https://github.com/esromneb/ios-queue-object/blob/master/NSMutableArray%2BQueueAdditions.h
#import <Foundation/Foundation.h>
#import "NSMutableArray+QueueAdditions.h"
@interface Queue : NSObject
{
//the queue
NSMutableArray* eventQueue;
//queue processor thread
NSThread* qProcessorThread;
//condition for queue's status
NSCondition* queueCondition;
}
/* PROPERTIES */
//items in
@property NSUInteger itemsIn;
//items out
@property NSUInteger itemsOut;
//event queue
@property(retain, atomic)NSMutableArray* eventQueue;
//thread to process events
@property (nonatomic, retain)NSThread* qProcessorThread;
//condition for queue
@property (nonatomic, retain)NSCondition* queueCondition;
//METHODS
//add an object to the queue
-(void)enqueue:(id)anObject;
//process events from queue
-(void)processQueue:(id)threadParam;
@end