pthread: introduce pthread_setname_np() as a mean to give names to threads

... so that each cloned process at the kernel level can be named
independently. Tools like 'top' can display the CPU/memory statistics
for each process's thread if "Show Threads" mode is on.

With this function in place, we can convert dalvik/Thread.c setThreadName()
function over this function. This feature ought to be provided by the
underlying C library and not coded directly in Dalvik.

Change-Id: Ifa997665dbaa114e0b126f8c667708be9a4137fd
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
This commit is contained in:
André Goddard Rosa
2010-05-19 23:17:16 -03:00
parent 1297428e89
commit 78c1c04ced
3 changed files with 62 additions and 0 deletions

View File

@@ -226,6 +226,8 @@ int pthread_getcpuclockid(pthread_t tid, clockid_t *clockid);
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void));
int pthread_setname_np(pthread_t thid, const char *thname);
typedef void (*__pthread_cleanup_func_t)(void*);
typedef struct __pthread_cleanup_t {