Hi, On 05/05/2012 12:17 AM, Pete Batard wrote: > On 4 May 2012 15:29, Sean McBride<s...@rogue-research.com> wrote: >> Do you necessarily need an integer to display? > > I meant integer in the mathematical sense, not the C sense (else I > would have used "int"). > >> You could also print the address of the pthread_t struct > > Which would be an integer alright, so why not... Not sure if the level > of reuse of addresses is the same as the level of reuse of thread IDs > though. > >> or use pthread_getname_np() to get a string name of the thread (though >> that's only available on 10.6 and later, and the 'np' means 'not portable'). > > Wouldn't that mean that OS-X would have different logging from other > platforms? > The aim is to have something that is similar accross platforms, and we > can do that. > >> libusbx is already calling pthread_setname_np() for the thread it creates. > > But only for OS X I assume... >
Sean, maybe it would be an idea for the os dependent code to print a thread "name" + id when creating a thread and debugging is enabled, this way a user can easily find which thread-id is which thread in the logs? Regards, Hans ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel