This is an attempt to enable checking (via REST API) if app (started via REST API) is still running.
In https://github.com/cloudius-systems/osv/issues/845 I suggested to use thread ID running app's main() to detect when is the application terminated. Termination of main() thread is usually same as termination of app. One exception - if there are extra threads created, and main() doesnt try to join() them, then app might be still doing usefull work. That might need to be implemented/fixed later. I "made up" an extra, nonportable pthread function - pthread_gettid_np. I wanted to use thread ID as app identifier, and didn't found any nicer way to convert pthread_t to ID. Justin Cinkelj (4): libc: add pthread_gettid_np to get thread ID of arbitrary pthread_t app: optionaly return thread ID of newly started app httpserver: return thread ID of the started app httpserver: report if application did finish core/app.cc | 12 ++++++-- include/api/pthread.h | 1 + include/osv/app.hh | 7 ++++- libc/pthread.cc | 5 ++++ modules/httpserver/api-doc/listings/app.json | 26 ++++++++++++++++++ modules/httpserver/api/app.cc | 41 +++++++++++++++++++++++++--- 6 files changed, 85 insertions(+), 7 deletions(-) -- 2.9.3 -- 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 osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.