Reputation: 4850
I have a threadSafe method that gets called by multiple threads. Is there a way to know which thread called it?
Upvotes: 0
Views: 403
Reputation: 22741
Well, you know the thread that calls the method, and by extension the same thread will be active inside that method call. You can just call QThread::currentThread()
to get this.
Upvotes: 3
Reputation: 17949
If you need it, you could add a threadId
parameter, and let it thread pass it to the method
Upvotes: 1