let’s say i have a singleton object with a static function:
static int MySingletonObject::getInt()
now i would like to return a different int depending on which workingthread (MFC threading) is calling the function.
I know that i can pass parameters to the threadingfunction when creating the thread. But Is there a way to identify the thread without info from those parameters?
Thanks!
You can call GetCurrentThreadId() – will return an integer identifier – or GetCurrentThread() – will return a handle which can be cast to an integer identifier – from any thread – those values will be unique for any thread within the process.