diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-12-29 20:03:47 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-12-29 20:03:47 +0000 |
commit | fd58f426d39e1b38125e38a6d279ba88b2b80239 (patch) | |
tree | 315e743cc2fd9af7c18e818bd27661cd12843262 /firmware | |
parent | 6406e61e5cd6c7c7f67c903eb58c3d53f99dc03c (diff) |
Return thread ID as a string for name when a thread isn't named or name cannot be used, as comment says, not slot pointer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28928 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/hosted/sdl/thread-sdl.c | 4 | ||||
-rw-r--r-- | firmware/thread.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/hosted/sdl/thread-sdl.c b/firmware/target/hosted/sdl/thread-sdl.c index 83f1d1960d..08f20367cc 100644 --- a/firmware/target/hosted/sdl/thread-sdl.c +++ b/firmware/target/hosted/sdl/thread-sdl.c @@ -670,9 +670,9 @@ void thread_get_name(char *buffer, int size, { /* Display thread name if one or ID if none */ bool named = thread->name && *thread->name; - const char *fmt = named ? "%s" : "%08lX"; + const char *fmt = named ? "%s" : "%04lX"; intptr_t name = named ? - (intptr_t)thread->name : (intptr_t)thread; + (intptr_t)thread->name : (intptr_t)thread->id; snprintf(buffer, size, fmt, name); } } diff --git a/firmware/thread.c b/firmware/thread.c index 24bbb317f9..b71bc1749c 100644 --- a/firmware/thread.c +++ b/firmware/thread.c @@ -2379,8 +2379,8 @@ void thread_get_name(char *buffer, int size, const char *fmt = "%s"; if (name == NULL IF_COP(|| name == THREAD_DESTRUCT) || *name == '\0') { - name = (const char *)thread; - fmt = "%08lX"; + name = (const char *)(unsigned int)thread->id; + fmt = "%04lX"; } snprintf(buffer, size, fmt, name); } |