Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp')
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp
index e5138166b..c62f4c07c 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp
@@ -11,6 +11,23 @@ namespace etRuntime {
TestSemaphore::~TestSemaphore() {
+ sem_destroy(&m_sem);
+}
+
+void TestSemaphore::printWaitingThreads() {
+ std::cout << ">>> begin semaphore info >>>" << std::endl;
+ int value;
+ sem_getvalue(&m_sem, &value);
+ std::cout << "value of the semaphore:" << value << std::endl;
+// std::cout << "current thread is " + Thread.currentThread().getName() << std::endl;
+// Collection < Thread > threads = getQueuedThreads();
+// if (threads.isEmpty())
+// std::cout << " no waiting threads" << std::endl;
+// else
+// for (Thread thread : threads) {
+// std::cout << " blocked: " << thread.getName() << std::endl;
+// }
+ std::cout << "<<< end semaphore info <<<" << std::endl;
}
} /* namespace etRuntime */

Back to the top