Implemented Request queue garbage collection.
This commit is contained in:
parent
02ca3d9bb5
commit
594914d33b
|
@ -39,6 +39,20 @@ public final class GarbageCollector : Thread
|
||||||
manager.lockQueue();
|
manager.lockQueue();
|
||||||
|
|
||||||
/* TODO: Add clean up here */
|
/* TODO: Add clean up here */
|
||||||
|
/* Construct a new list */
|
||||||
|
Request[] newList;
|
||||||
|
|
||||||
|
/* Only add to this list unfulfilled requests */
|
||||||
|
foreach(Request request; *requestQueueVariable)
|
||||||
|
{
|
||||||
|
if(!request.isFulfilled())
|
||||||
|
{
|
||||||
|
newList ~= request;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Update the queue to the new queue */
|
||||||
|
*requestQueueVariable = newList;
|
||||||
|
|
||||||
/* Unlock the queue */
|
/* Unlock the queue */
|
||||||
manager.unlockQueue();
|
manager.unlockQueue();
|
||||||
|
|
Loading…
Reference in New Issue