From ea32c7eef41dec74f570914500de1bc22d6d9350 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Wed, 8 Sep 2021 13:46:05 +0200 Subject: [PATCH] Re-implemented `isValidTag(ulong)` --- source/tristanable/manager.d | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/source/tristanable/manager.d b/source/tristanable/manager.d index 22adc3c..9429c85 100644 --- a/source/tristanable/manager.d +++ b/source/tristanable/manager.d @@ -62,6 +62,12 @@ public final class Manager return matchingQueue; } + /* TODO: Probably remove this or keep it */ + public bool isValidTag(ulong tag) + { + return !(getQueue(tag) is null); + } + /** * Returns a new queue with a new ID, * if all IDs are used then it returns @@ -69,6 +75,8 @@ public final class Manager * * Use this if you don't care about reserving * queues IDs and just want a throwaway queue + * + * FIXME: All tags in use, this won't handle it */ public Queue generateQueue() { @@ -139,22 +147,10 @@ public final class Manager 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; - } - - + /** + * TODO: Comment + * TODO: Testing + */ public void shutdown() { /* TODO: Implement me */