This is the usage case:
Log(char* s); // prints out a log message
Now:
Log("hello world\n"); // called from Thread1
Desired output:
Thread1: hello world
Now:
Log("hello world\n"); // called from Thread2
Desired output:
Thread2: hello world
I can have a map that maps thread pids to strings. What I need however, is a function that when called form different threads gives me unique identification tags. Is this possible?
Thanks!
(Langauge: C/C++)