apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DEBIN GAO" <gaode...@hotmail.com>
Subject apr_os_thread_current() on Windows - why not use GetCurrentThreadId()?
Date Thu, 08 Jun 2006 21:35:34 GMT
Hi all,

I'm looking at the implementation of apr_os_thread_current() on Windows, and 
wonder why not use GetCurrentThreadId() to return the thread id?  The 
current implementation uses GetCurrentThread() and DuplicateHandle(), which 
returns a handle rather than the id.

I come across apr_os_thread_current() when working on the logs of httpd, 
which uses apr_os_thread_current() to log the thread id.  I'm not sure why 
the handle is logged instead.  I don't think we are expecting users to use 
this handle to do something to the thread, but rather we just want an id to 
uniquely identify the thread, and possibly help troubleshooting.

My current project requires me to match the information I get from a kernel 
driver with a client request to the httpd.  I can get the thread id from 
kernel by using PsGetCurrentThreadId(), but that is different from the 
handle that is logged by httpd.  Is there a way to relate the two?

Thanks for reading.



Mime
View raw message