summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-06-03 10:44:29 +0200
committerGitHub <noreply@github.com>2022-06-03 10:44:29 +0200
commitb689e431346217d3b7c0bd93c51a0779abbf1f82 (patch)
treee7cf7452d2e14c20ced90aca378784bb32b2b045 /vespalib
parent4de7535b808cea2aa271db2fa6f8dcdcc7f1be17 (diff)
parentd0701928d86487e5331bd8159cf7da49004edbef (diff)
Merge pull request #22874 from vespa-engine/vekterli/dump-stack-of-deadlocked-thread
Let deadlock detector dump stack of potentially deadlocked threads
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/document_runnable.cpp5
-rw-r--r--vespalib/src/vespa/vespalib/util/document_runnable.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/document_runnable.cpp b/vespalib/src/vespa/vespalib/util/document_runnable.cpp
index d7534514f41..c0af72dbbb1 100644
--- a/vespalib/src/vespa/vespalib/util/document_runnable.cpp
+++ b/vespalib/src/vespa/vespalib/util/document_runnable.cpp
@@ -72,6 +72,11 @@ bool Runnable::join() const
return true;
}
+FastOS_ThreadId Runnable::native_thread_id() const noexcept
+{
+ return GetThread()->GetThreadId();
+}
+
void Runnable::Run(FastOS_ThreadInterface*, void*)
{
{
diff --git a/vespalib/src/vespa/vespalib/util/document_runnable.h b/vespalib/src/vespa/vespalib/util/document_runnable.h
index 5ca344ea7ef..89388bac34c 100644
--- a/vespalib/src/vespa/vespalib/util/document_runnable.h
+++ b/vespalib/src/vespa/vespalib/util/document_runnable.h
@@ -88,6 +88,8 @@ public:
* Checks if runnable is running or not. (Started is considered running)
*/
[[nodiscard]] bool running() const noexcept;
+
+ FastOS_ThreadId native_thread_id() const noexcept;
};
}