Browse Source

IOSAD-157 PEPQueue has prequeue (push to front)

IOSAD-157
Dirk Zimmermann 3 years ago
parent
commit
fdab275fab
2 changed files with 17 additions and 2 deletions
  1. +5
    -0
      pEpObjCAdapter/PEPQueue.h
  2. +12
    -2
      pEpObjCAdapter/PEPQueue.m

+ 5
- 0
pEpObjCAdapter/PEPQueue.h View File

@ -18,6 +18,11 @@ typedef void (^deleteOp)(id);
/// @param object The object to put into the queue.
- (void)enqueue:(id)object;
/// Puts an object into the queue, so that it will be dequeued before the
/// existing objects.
/// @param object The object to put into the queue.
- (void)prequeue:(id)object;
- (id)timedDequeue:(time_t*)timeout;
- (id)dequeue;


+ 12
- 2
pEpObjCAdapter/PEPQueue.m View File

@ -40,9 +40,19 @@
}
[_cond signal];
[_cond unlock];
}
- (void)prequeue:(id)object
{
[_cond lock];
if (_queue) {
[_queue addObject:object];
}
[_cond signal];
[_cond unlock];
}
- (id)timedDequeue:(time_t*)timeout


Loading…
Cancel
Save