tristanable/source/tristanable/manager2.d

52 lines
629 B
D
Raw Normal View History

2020-09-29 09:57:25 +00:00
public final class Manager
{
/* All queues */
private Queue[] queues;
private Mutex queuesLock;
/* TODO Add drop queue? */
this()
{
}
public void addQueue()
{
}
private bool isValidTag_callerThreadSafe(ulong tag)
{
bool tagExists;
foreach(Queue queue; queues)
{
if(queue.getTag() == tag)
{
tagExists = true;
break;
}
}
return tagExists;
}
public bool isValidTag(ulong tag)
{
/* Whether or not such a tagged queue exists */
bool tagExists;
queuesLock.lock();
tagExists = isValidTag_callerThreadSafe(tag);
queuesLock.unlock();
return tagExists;
}
}