changeset 4169:e8005a58de16

SharedMessageQueue::GetSize()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 01 Sep 2020 14:22:15 +0200
parents 88d704264d64
children 1657c8700974 822d3a17d797
files OrthancFramework/Sources/MultiThreading/SharedMessageQueue.cpp OrthancFramework/Sources/MultiThreading/SharedMessageQueue.h
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/MultiThreading/SharedMessageQueue.cpp	Tue Sep 01 10:19:29 2020 +0200
+++ b/OrthancFramework/Sources/MultiThreading/SharedMessageQueue.cpp	Tue Sep 01 14:22:15 2020 +0200
@@ -197,4 +197,10 @@
       emptied_.notify_all();
     }
   }
+
+  size_t SharedMessageQueue::GetSize()
+  {
+    boost::mutex::scoped_lock lock(mutex_);
+    return queue_.size();
+  }
 }
--- a/OrthancFramework/Sources/MultiThreading/SharedMessageQueue.h	Tue Sep 01 10:19:29 2020 +0200
+++ b/OrthancFramework/Sources/MultiThreading/SharedMessageQueue.h	Tue Sep 01 14:22:15 2020 +0200
@@ -70,5 +70,7 @@
     void SetLifoPolicy();
 
     void Clear();
+
+    size_t GetSize();
   };
 }