|
|
DescriptionRemove lock from SharedMemoryDataConsumerHandle::Context destructor
SharedMemoryDataConsumerHandle::Context posts tasks while its lock_
locked. That means a lock held by the TaskRunner will be locked
after |lock_| is locked. On the other hand, the Context may be
destructed in the middle of TaskRunner destruction, which means we
cannot lock |lock_| in the Context destruction. Otherwise, a
lock-order-inversion problem will be introduced.
This CL stops locking |lock_| in the destructor. It is safe because
no one accesses to Content's member variables without a valid
scoped_refptr to the Context.
BUG=651747
Committed: https://crrev.com/d9a07ccafb34327cc194631d354395245f65a52b
Cr-Commit-Position: refs/heads/master@{#422614}
Patch Set 1 : fix #Patch Set 2 : fix #Patch Set 3 : fix #Patch Set 4 : fix #
Messages
Total messages: 36 (28 generated)
The CQ bit was checked by yhirano@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...
The CQ bit was checked by yhirano@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...
The CQ bit was checked by yhirano@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 ========== thread fix BUG=651747 ========== to ========== Remove lock from SharedMemoryDataConsumerHandle::Context destructor SharedMemoryDataConsumerHandle::Context posts tasks while its lock_ locked. That means a lock held by the TaskRunner will be locked after |lock_| is locked. On the other hand, the Context may be destructed in the middle of TaskRunner destruction, which means we cannot lock |lock_| in the Context destruction. Otherwise, a lock-order-inversion problem will be introduced. BUG=651747 ==========
yhirano@chromium.org changed reviewers: + hiroshige@chromium.org
The CQ bit was checked by yhirano@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...
The CQ bit was checked by yhirano@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 #3 (id:40001) has been deleted
Patchset #2 (id:20001) has been deleted
Patchset #1 (id:1) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by yhirano@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...
The CQ bit was checked by yhirano@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...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm with a comment to CL description: Could you add explanation why removing the lock in ~Context() is safe? (Splitting this CL into two CLs, one for replacing raw pointer with unique_ptr and one for removing lock in ~Context() might be clearer but this CL is also OK) (FYI I blamed the code and the lock was added by me at https://codereview.chromium.org/1234213002/#ps60001. The lock looks like added to make ~Context() consistent with lock_.AssertAquired() added to Clear().)
Description was changed from ========== Remove lock from SharedMemoryDataConsumerHandle::Context destructor SharedMemoryDataConsumerHandle::Context posts tasks while its lock_ locked. That means a lock held by the TaskRunner will be locked after |lock_| is locked. On the other hand, the Context may be destructed in the middle of TaskRunner destruction, which means we cannot lock |lock_| in the Context destruction. Otherwise, a lock-order-inversion problem will be introduced. BUG=651747 ========== to ========== Remove lock from SharedMemoryDataConsumerHandle::Context destructor SharedMemoryDataConsumerHandle::Context posts tasks while its lock_ locked. That means a lock held by the TaskRunner will be locked after |lock_| is locked. On the other hand, the Context may be destructed in the middle of TaskRunner destruction, which means we cannot lock |lock_| in the Context destruction. Otherwise, a lock-order-inversion problem will be introduced. This CL stops locking |lock_| in the destructor. It is safe because no one accesses to Content's member variables without a valid scoped_refptr to the Context. BUG=651747 ==========
On 2016/10/03 11:09:25, hiroshige wrote: > lgtm with a comment to CL description: > Could you add explanation why removing the lock in ~Context() is safe? > Done.
yhirano@chromium.org changed reviewers: + jam@chromium.org
+jam@ for OWNER review.
lgtm
The CQ bit was checked by yhirano@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 ========== Remove lock from SharedMemoryDataConsumerHandle::Context destructor SharedMemoryDataConsumerHandle::Context posts tasks while its lock_ locked. That means a lock held by the TaskRunner will be locked after |lock_| is locked. On the other hand, the Context may be destructed in the middle of TaskRunner destruction, which means we cannot lock |lock_| in the Context destruction. Otherwise, a lock-order-inversion problem will be introduced. This CL stops locking |lock_| in the destructor. It is safe because no one accesses to Content's member variables without a valid scoped_refptr to the Context. BUG=651747 ========== to ========== Remove lock from SharedMemoryDataConsumerHandle::Context destructor SharedMemoryDataConsumerHandle::Context posts tasks while its lock_ locked. That means a lock held by the TaskRunner will be locked after |lock_| is locked. On the other hand, the Context may be destructed in the middle of TaskRunner destruction, which means we cannot lock |lock_| in the Context destruction. Otherwise, a lock-order-inversion problem will be introduced. This CL stops locking |lock_| in the destructor. It is safe because no one accesses to Content's member variables without a valid scoped_refptr to the Context. BUG=651747 ==========
Message was sent while issue was closed.
Committed patchset #4 (id:40002)
Message was sent while issue was closed.
Description was changed from ========== Remove lock from SharedMemoryDataConsumerHandle::Context destructor SharedMemoryDataConsumerHandle::Context posts tasks while its lock_ locked. That means a lock held by the TaskRunner will be locked after |lock_| is locked. On the other hand, the Context may be destructed in the middle of TaskRunner destruction, which means we cannot lock |lock_| in the Context destruction. Otherwise, a lock-order-inversion problem will be introduced. This CL stops locking |lock_| in the destructor. It is safe because no one accesses to Content's member variables without a valid scoped_refptr to the Context. BUG=651747 ========== to ========== Remove lock from SharedMemoryDataConsumerHandle::Context destructor SharedMemoryDataConsumerHandle::Context posts tasks while its lock_ locked. That means a lock held by the TaskRunner will be locked after |lock_| is locked. On the other hand, the Context may be destructed in the middle of TaskRunner destruction, which means we cannot lock |lock_| in the Context destruction. Otherwise, a lock-order-inversion problem will be introduced. This CL stops locking |lock_| in the destructor. It is safe because no one accesses to Content's member variables without a valid scoped_refptr to the Context. BUG=651747 Committed: https://crrev.com/d9a07ccafb34327cc194631d354395245f65a52b Cr-Commit-Position: refs/heads/master@{#422614} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/d9a07ccafb34327cc194631d354395245f65a52b Cr-Commit-Position: refs/heads/master@{#422614} |