diff --git a/source/tristanable/manager.d b/source/tristanable/manager.d index ee4fc42..68f3b21 100644 --- a/source/tristanable/manager.d +++ b/source/tristanable/manager.d @@ -271,6 +271,18 @@ public final class Manager return false; } + + public void addNotification(NotificationReply notificationReply) + { + /* Lock the notification queue */ + lockNotificationQueue(); + + /* Append the notification */ + notificationQueue ~= notificationReply; + + /* Unlock the notification queue */ + unlockNotificationQueue(); + } } diff --git a/source/tristanable/watcher.d b/source/tristanable/watcher.d index 27431fe..bf1d5d2 100644 --- a/source/tristanable/watcher.d +++ b/source/tristanable/watcher.d @@ -92,14 +92,11 @@ public final class Watcher : Thread */ else if(manager.isReservedTag(receivedTag)) { - /* Lock the notification queue */ - manager.lockNotificationQueue(); - /* Create the NotificationReply */ NotificationReply notifyReply = new NotificationReply(receivedTag, receivedMessage); - /* Unlock the notification queue */ - manager.unlockNotificationQueue(); + /* Add the notification */ + manager.addNotification(notifyReply); } else {