Get the calling thread's id

18 views
Skip to first unread message

Android007

unread,
Nov 19, 2012, 4:13:46 AM11/19/12
to android-...@googlegroups.com
Hi,
Is it possible to retrieve the id of a thread that called a certain function? (assuming this function can be called from several threads)
I know that it is possible to ask a Binder object which Process had called it, but is it also possible with threads from the same process?

Thanks

blake

unread,
Nov 21, 2012, 10:33:19 AM11/21/12
to android-...@googlegroups.com
Sure!  Thread.currentThread() from within the function, will give you the thread on which the function is being called.

-blake
Reply all
Reply to author
Forward
0 new messages