[webkit-reviews] review requested: [Bug 54836] Get rid of posixThread in MachineStackMarker::Thread : [Attachment 83105] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 14 06:29:02 PDT 2011


Patrick R. Gansterer <paroga at paroga.com> has asked  for review:
Bug 54836: Get rid of posixThread in MachineStackMarker::Thread
https://bugs.webkit.org/show_bug.cgi?id=54836

Attachment 83105: Patch
https://bugs.webkit.org/attachment.cgi?id=83105&action=review

------- Additional Comments from Patrick R. Gansterer <paroga at paroga.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=83105&action=review

>> Source/JavaScriptCore/runtime/MachineStackMarker.cpp:100
>> +	    : platformThread(platThread)
> 
> One subtle thing about moving from pthreads to PlatformThreads could be
whether the IDs are reused after thread termination. I didn't think much about
this, because I have bigger concerns below.

it's possible that a pthread_t can be reused too (at least on windows) see
http://sourceware.org/cgi-bin/cvsweb.cgi/pthreads/ptw32_reuse.c?rev=1.11&cvsroo
t=pthreads-win32

>> Source/JavaScriptCore/runtime/MachineStackMarker.cpp:145
>> +	return GetCurrentThread();
> 
> MSDN says that GetCurrentThread() returns a special constant that you can
pass to threading functions. Does this mean that all PlatformThreads will be
numerically the same on Windows?
> 
> If this is indeed a mistake, I'm concerned about our regression test
coverage.

http://msdn.microsoft.com/en-us/library/ms683182%28v=vs.85%29.aspx says The
return value is a pseudo handle for the current thread.
It behaves "like" GetCurrentThreadId() but uses HANDLE instead of DWORD as
return value.

>> Source/JavaScriptCore/runtime/MachineStackMarker.cpp:187
>> +	if (m_registeredThreads->platformThread == currentPlatformThread) {
> 
> Is it OK to compare handles and Mach ports numerically? Is that documented
somewhere?

any good idea where i can find this info?


More information about the webkit-reviews mailing list