|
|
Chromium Code Reviews|
Created:
4 years, 3 months ago by nhiroki Modified:
4 years, 3 months ago CC:
chromium-reviews, shimazu+worker_chromium.org, falken, kinuko+worker_chromium.org, blink-reviews, horo+watch_chromium.org, blink-worker-reviews_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionWorker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup
Motivation of this change is to improve readability/testability of the current
complex critical section, and to make it more robust to future changes.
BUG=640843
Committed: https://crrev.com/ece89237c1fe0cf950bfb405d9c214b7b0fd7aff
Cr-Commit-Position: refs/heads/master@{#418103}
Patch Set 1 : fix #
Total comments: 3
Patch Set 2 : check Mutex.locked() #Patch Set 3 : fix compile failures #
Total comments: 6
Patch Set 4 : fix comments #
Messages
Total messages: 46 (31 generated)
The CQ bit was checked by nhiroki@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #1 (id:1) has been deleted
The CQ bit was checked by nhiroki@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Worker: Factor out parts of WorkerThread::terminateInternal() into their own functions for cleanup BUG= ========== to ========== Worker: Factor out parts of WorkerThread::terminateInternal() into their own functions for cleanup BUG=n/a ==========
Patchset #1 (id:20001) has been deleted
Description was changed from ========== Worker: Factor out parts of WorkerThread::terminateInternal() into their own functions for cleanup BUG=n/a ========== to ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own functions for cleanup BUG=n/a ==========
The CQ bit was checked by nhiroki@chromium.org to run a CQ dry run
Patchset #1 (id:10003) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own functions for cleanup BUG=n/a ========== to ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup BUG=n/a ==========
nhiroki@chromium.org changed reviewers: + haraken@chromium.org, yhirano@chromium.org
Hi, can you review this? My motivation for this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. Thanks! https://codereview.chromium.org/2325923002/diff/50001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.h (right): https://codereview.chromium.org/2325923002/diff/50001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.h:204: bool shouldScheduleToTerminateExecution(const MutexLocker&); What do you think about this pattern to ensure a caller holds a lock?
LGTM https://codereview.chromium.org/2325923002/diff/50001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.h (right): https://codereview.chromium.org/2325923002/diff/50001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.h:204: bool shouldScheduleToTerminateExecution(const MutexLocker&); On 2016/09/09 05:51:04, nhiroki wrote: > What do you think about this pattern to ensure a caller holds a lock? I'm fine with this but can we add DCHECK(locked()) to those methods?
The CQ bit was checked by nhiroki@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thank you! https://codereview.chromium.org/2325923002/diff/50001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.h (right): https://codereview.chromium.org/2325923002/diff/50001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.h:204: bool shouldScheduleToTerminateExecution(const MutexLocker&); On 2016/09/09 06:41:01, haraken wrote: > On 2016/09/09 05:51:04, nhiroki wrote: > > What do you think about this pattern to ensure a caller holds a lock? > > I'm fine with this but can we add DCHECK(locked()) to those methods? Good idea. Added checks.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromeos_x86-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...)
LGTM
Hmmm..., chromeos builds are failing because Mutex.locked() is not defined. Apparently, on the bots, DCHECK() is defined but ENABLE(ASSERT)[1] is not defined. I'll investigate this more... [1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/wtf/ThreadingP...
On 2016/09/09 08:28:37, nhiroki wrote: > Hmmm..., chromeos builds are failing because Mutex.locked() is not defined. > Apparently, on the bots, DCHECK() is defined but ENABLE(ASSERT)[1] is not > defined. I'll investigate this more... > > [1] > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/wtf/ThreadingP... OK, I understand the situation. I wrongly assumed that DCHECK(condition) is completely no-op on release build, but actually it generates a code like this: #define DCHECK(condition) \ LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() ? !(condition) : false) \ << "Check failed: " #condition ". " So, |condition| must be valid even on release build. I'll fix the condition...
The CQ bit was checked by nhiroki@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/09/09 10:08:08, nhiroki wrote: > On 2016/09/09 08:28:37, nhiroki wrote: > > Hmmm..., chromeos builds are failing because Mutex.locked() is not defined. > > Apparently, on the bots, DCHECK() is defined but ENABLE(ASSERT)[1] is not > > defined. I'll investigate this more... > > > > [1] > > > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/wtf/ThreadingP... > > OK, I understand the situation. I wrongly assumed that DCHECK(condition) is > completely no-op on release build, but actually it generates a code like this: > > #define DCHECK(condition) \ > LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() ? !(condition) : false) \ > << "Check failed: " #condition ". " > > So, |condition| must be valid even on release build. I'll fix the condition... Fixed. Can you take another look?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup BUG=n/a ========== to ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup Motivation of this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. BUG=n/a ==========
https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.cpp:695: void WorkerThread::setExitCode(const MutexLocker& lock, ExitCode exitCode) Sorry, can you explain why |lock| is needed? https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.h (right): https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.h:201: // terminate the worker execution so that a shutdown task can be handle by s/be handle/be handled/ https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.h:202: // thread event loop. This must be called with |m_threadStateMutex| [optional] perhaps "the" thread event loop is better?
Thank you! https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.cpp:695: void WorkerThread::setExitCode(const MutexLocker& lock, ExitCode exitCode) On 2016/09/12 09:14:48, yhirano (slow) wrote: > Sorry, can you explain why |lock| is needed? This is a kind of an annotation to clarify that this function requires a caller to acquire the lock. (See https://codereview.chromium.org/2325923002/diff/50001/third_party/WebKit/Sour...) https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.h (right): https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.h:201: // terminate the worker execution so that a shutdown task can be handle by On 2016/09/12 09:14:48, yhirano (slow) wrote: > s/be handle/be handled/ Done. https://codereview.chromium.org/2325923002/diff/90001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.h:202: // thread event loop. This must be called with |m_threadStateMutex| On 2016/09/12 09:14:48, yhirano (slow) wrote: > [optional] perhaps "the" thread event loop is better? Done.
lgtm
The CQ bit was checked by nhiroki@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from haraken@chromium.org Link to the patchset: https://codereview.chromium.org/2325923002/#ps110001 (title: "fix comments")
The CQ bit was unchecked by nhiroki@chromium.org
Description was changed from ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup Motivation of this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. BUG=n/a ========== to ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup Motivation of this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. BUG=640843 ==========
The CQ bit was checked by nhiroki@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by nhiroki@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup Motivation of this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. BUG=640843 ========== to ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup Motivation of this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. BUG=640843 ==========
Message was sent while issue was closed.
Committed patchset #4 (id:110001)
Message was sent while issue was closed.
Description was changed from ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup Motivation of this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. BUG=640843 ========== to ========== Worker: Factor out a part of WorkerThread::terminateInternal() into its own function for cleanup Motivation of this change is to improve readability/testability of the current complex critical section, and to make it more robust to future changes. BUG=640843 Committed: https://crrev.com/ece89237c1fe0cf950bfb405d9c214b7b0fd7aff Cr-Commit-Position: refs/heads/master@{#418103} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/ece89237c1fe0cf950bfb405d9c214b7b0fd7aff Cr-Commit-Position: refs/heads/master@{#418103} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
