If two threads can access a service (that sits in the same process they are 
- the service could have created these threads) and use its methods, I want 
the service to know who was the caller.
I think that Thread.getId returns the current running thread (in this case, 
if the service calls this function, it will always receive its own thread 
Id).



On Monday, November 19, 2012 12:38:02 PM UTC+2, Johan Appelgren wrote:
>
> You can get the thread id using Thread.getId() 
> http://developer.android.com/reference/java/lang/Thread.html#getId()
>
> On Monday, November 19, 2012 10:14:27 AM UTC+1, AndroidCompile wrote:
>>
>> 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
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to