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
|