apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: apr_os_thread_current() on Windows - why not use GetCurrentThreadId()?
Date Thu, 08 Jun 2006 22:38:33 GMT
DEBIN GAO wrote:
> 
> 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.

On Unix, you manage a thread by it's ID.

On Windows, you manage a thread by it's Handle.

An apr_os_thread is a manageable object, it's not possible on a secure
application to fiddle with a thread id.

There should already be a mechanism to convert os_thread to tid, but if not
it's purely an oversight and patches would be welcome (a trivial one liner
in unix of course.)

Bill

Mime
View raw message