2010/11/22 Daniel P. Berrange <berrange@xxxxxxxxxx>: > To allow messages from different threads to be untangled, > include an integer thread identifier in log messages. > > +int virThreadSelfID(void) > +{ > + Â ÂHANDLE handle = GetCurrentThread(); > + Â ÂHANDLE process = GetCurrentProcess(); > + Â ÂHANDLE thread; > + Â Âint id; > + > + Â ÂDuplicateHandle(process, handle, process, > + Â Â Â Â Â Â Â Â Â Â&thread, 0, FALSE, > + Â Â Â Â Â Â Â Â Â ÂDUPLICATE_SAME_ACCESS); > + Â Âid = (int)thread; > + Â ÂCloseHandle(thread); > + Â Âreturn id; > +} You could use GetCurrentThreadId() here instead of the handle value. Matthias -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list