From: Justin Cinkelj <[email protected]>
Committer: Nadav Har'El <[email protected]>
Branch: master

app: return thread ID running app's main function

Signed-off-by: Justin Cinkelj <[email protected]>
Message-Id: <[email protected]>

---
diff --git a/core/app.cc b/core/app.cc
--- a/core/app.cc
+++ b/core/app.cc
@@ -419,6 +419,10 @@ std::string application::get_command()
     return _command;
 }

+pid_t application::get_main_thread_id() {
+    return pthread_gettid_np(_thread);
+}
+
// For simplicity, we will not reuse bits in the bitmap, since no destructor is // assigned to the program. In that case, a simple counter would do. But coding
 // this way is easy, and make this future extension simple.
diff --git a/include/osv/app.hh b/include/osv/app.hh
--- a/include/osv/app.hh
+++ b/include/osv/app.hh
@@ -174,6 +174,11 @@ public:
      */
     std::string get_command();

+    /**
+      * Returns thread_id/PID of thread running app main() function.
+      */
+    pid_t get_main_thread_id();
+
std::shared_ptr<application_runtime> runtime() const { return _runtime; }
     std::shared_ptr<elf::object> lib() const { return _lib; }

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to