RESOLVED FIXED 91899
[BlackBerry] Merge createThreadInternal implementations
https://bugs.webkit.org/show_bug.cgi?id=91899
Summary [BlackBerry] Merge createThreadInternal implementations
Rob Buis
Reported 2012-07-20 13:26:54 PDT
We do things differently for BlackBerry port, but the code is similar enough to merge the two createThreadInternal implementations.
Attachments
Patch (4.07 KB, patch)
2012-07-20 13:35 PDT, Rob Buis
no flags
Patch (4.25 KB, patch)
2012-07-20 14:11 PDT, Rob Buis
no flags
Patch (4.25 KB, patch)
2012-07-20 14:25 PDT, Rob Buis
no flags
Patch (3.34 KB, patch)
2012-07-23 08:27 PDT, Rob Buis
yong.li.webkit: review+
Rob Buis
Comment 1 2012-07-20 13:35:13 PDT
Yong Li
Comment 2 2012-07-20 13:48:27 PDT
Comment on attachment 153586 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153586&action=review Basically it looks good to me. But I would wait some time for other volunteers to review if any. > Source/WTF/wtf/ThreadingPthreads.cpp:181 > + bool setStackSize = stackSize > 0; > + if (setStackSize) { This setStackSize is not needed. size_t must be >= 0 anyway. if (stackSize) { ... > Source/WTF/wtf/ThreadingPthreads.cpp:198 > - if (pthread_create(&threadHandle, &attr, wtfThreadEntryPoint, invocation.get())) { > - LOG_ERROR("pthread_create() failed: %d", errno); > + if (pthread_create(&threadHandle, setStackSize ? &attr : 0, wtfThreadEntryPoint, invocation.get())) { > + LOG_ERROR("Failed to create pthread at entry point %p with data %p: %d", wtfThreadEntryPoint, invocation.get(), errno); I would still leave pthread_create() there: 1) it is easy to search it in log file or handle the log with a script. 2) be consistent with other logs "<pthread function> failed:..." We can add more information at the end...
Early Warning System Bot
Comment 3 2012-07-20 13:56:51 PDT
Rob Buis
Comment 4 2012-07-20 14:10:54 PDT
Related to bug 40103.
WebKit Review Bot
Comment 5 2012-07-20 14:11:24 PDT
Comment on attachment 153586 [details] Patch Attachment 153586 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13304433
Rob Buis
Comment 6 2012-07-20 14:11:50 PDT
Gustavo Noronha (kov)
Comment 7 2012-07-20 14:17:10 PDT
Early Warning System Bot
Comment 8 2012-07-20 14:21:26 PDT
Rob Buis
Comment 9 2012-07-20 14:25:25 PDT
WebKit Review Bot
Comment 10 2012-07-20 14:52:46 PDT
Comment on attachment 153601 [details] Patch Attachment 153601 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13301492
Early Warning System Bot
Comment 11 2012-07-20 14:55:42 PDT
Alexey Proskuryakov
Comment 12 2012-07-20 14:58:46 PDT
Comment on attachment 153601 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153601&action=review > Source/WTF/wtf/ThreadingPthreads.cpp:171 > +static size_t threadStackSize() I suggest naming this something like desiredSecondaryThreadStackSize. Comments from bug 40103 still apply - if you are adding this to cross platform code, you need to explain how to choose the desired size. > Source/WTF/wtf/ThreadingPthreads.cpp:195 > + else if (pthread_attr_setstack(&attr, stackAddr, stackSize)) > LOG_ERROR("pthread_attr_getstack() failed: %d", errno); The error message mentions a wrong function. Why is error handling different here? If pthread_attr_init fails, the thread is not created, but here, errors are ignored. What guarantees that there is enough space for a larger stack at stackAddr? > Source/WTF/wtf/ThreadingPthreads.cpp:204 > pthread_setname_np(threadHandle, threadName); This will break build for platforms that don't have pthread_np.h, or don't have this particular function. Besides, I'm fairly sure that other ports give names to threads elsewhere.
Alexey Proskuryakov
Comment 13 2012-07-20 15:00:13 PDT
[Blackberry] prefix on the bug is incorrect, because it changes cross-platofrm code. [Prefixes] are an aid for people to quickly ignore patches they definitely don't care about.
Rob Buis
Comment 14 2012-07-23 08:27:52 PDT
Yong Li
Comment 15 2012-07-23 08:39:10 PDT
Comment on attachment 153804 [details] Patch LGTM except the bug title should be changed to [BlackBerry] ...
Antonio Gomes
Comment 16 2012-07-23 08:45:43 PDT
(In reply to comment #15) > (From update of attachment 153804 [details]) > LGTM except the bug title should be changed to [BlackBerry] ... I think making this bug title [BlackBerry] specific and having the patch using #if (qnx) iis also confusing.
Yong Li
Comment 17 2012-07-23 08:48:09 PDT
(In reply to comment #16) > (In reply to comment #15) > > (From update of attachment 153804 [details] [details]) > > LGTM except the bug title should be changed to [BlackBerry] ... > > I think making this bug title [BlackBerry] specific and having the patch using #if (qnx) iis also confusing. We have been doing this... Should we use [QNX] instead?
Antonio Gomes
Comment 18 2012-07-23 09:04:26 PDT
(In reply to comment #17) > (In reply to comment #16) > > (In reply to comment #15) > > > (From update of attachment 153804 [details] [details] [details]) > > > LGTM except the bug title should be changed to [BlackBerry] ... > > > > I think making this bug title [BlackBerry] specific and having the patch using #if (qnx) iis also confusing. > > We have been doing this... Should we use [QNX] instead? If other qnx based platforms want this, yes. think of qtwebkit running in qnx, for example... Otherwise, use [bb] and make #if platform(bb)
Rob Buis
Comment 19 2012-07-23 09:43:04 PDT
Note You need to log in before you can comment on or make changes to this bug.