diff options
author | Jonathan Pryor <jonpryor@vt.edu> | 2016-01-25 21:42:32 +0300 |
---|---|---|
committer | Jonathan Pryor <jonpryor@vt.edu> | 2016-01-25 22:29:00 +0300 |
commit | bbe1010ef4f51bd7c1be884194c93317aadb49c5 (patch) | |
tree | 7ef02e1098df904b16feb193afc905aeb149912c /docs | |
parent | c5b1a68cbaeeeca101a4ed7703acaec349d41455 (diff) |
[runtime] Allow getting thread name, managed id from embedding API
When tracing multi-threaded program execution, it is useful to have a
way of separating which events happen on which thread. The
System.Threading.Thread.Name and Thread.ManagedThreadId properties are
useful proxies for tracking program execution.
However, if program execution spans both managed and embedded mono
native code, there is no existing mechanism to read the Thread.Name or
Thread.ManagedThreadId properties from native code without using
delegates, and delegates may not be usable in all circumstances (e.g.
within a mono_gc_register_bridge_callbacks() callback).
Add the following APIs to the embedding API to permit reading the
Thread.Name and Thread.ManagedThreadId properties:
char *mono_thread_get_name_utf8 (MonoThread *thread);
gint32 mono_thread_get_managed_id (MonoThread *thread);
mono_thread_get_name_utf8() returns the Thread.Name value as a UTF-8
string in newly allocated memory; the caller must g_free() this value.
mono_thread_get_managed_id() returns the Thread.ManagedThreadId value.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/public-api | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/public-api b/docs/public-api index c9d90eb25bd..31e42c6fe77 100644 --- a/docs/public-api +++ b/docs/public-api @@ -750,6 +750,8 @@ mono_thread_current mono_thread_detach mono_thread_exit mono_thread_get_main +mono_thread_get_managed_id +mono_thread_get_name_utf8 mono_thread_get_undeniable_exception mono_thread_hazardous_free_or_queue mono_thread_hazardous_try_free_all |