/** * Moves back a blocked thread to a priority queue. * Has no effect on unblocked threads. */ void PriorityQueue::resume(int id) { int location = isBlocked(id); if (location != -1) { enqueueElement(_Blocked.at(location)); _Blocked.erase(_Blocked.begin() + location); } }
void requeueElement (Element *element) { unlinkElement(element); enqueueElement(element); }
Element * enqueueItem (Queue *queue, void *item) { Element *element = newElement(queue, item); if (element) enqueueElement(element); return element; }