The callers thread will always be the same as the current thread. If a thread calls a function, the thread passes into a function. The only case where this is not true if when creating a new thread, and in that case, the only way would be to pass the creators thread ID to the new thread.
As Sean points out, the current thread will always be the same as the caller's thread. If you want to see if the caller's thread is different then another thread (like the main thread) you'll have to store a reference to that thread (via Thread.CurrentThread upon startup) then compare that to Thread.CurrentThread in the code that could be called by another thread.
You can use System.Threading.Thread.CurrentThread.ManagedThreadId to get an Id of the thread. You can then compare the thread ids to see if they are different.
How to get caller's thread?
Bubba76
Amos Soma
JohnBurton
You can use System.Threading.Thread.CurrentThread.ManagedThreadId to get an Id of the thread. You can then compare the thread ids to see if they are different.
Mark.