Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Issue 2023113002: Fix bug of posting task inside constructor (Closed)

Created:
4 years, 6 months ago by Yuwei
Modified:
4 years, 6 months ago
Reviewers:
Lambros
CC:
chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix bug of posting task inside constructor Refcounted object is initialized to have zero refcount and will be increased to 1 in RefCountedThreadSafe::operator=(). There is a chance that ConnectToHost finishes earlier than operator=(), which drops the refcount to 0 and triggers the d'tor. Adding sleep(1) after PostTask() shows stable repro of this problem. This CL fixes this problem by pulling the PostTask code out of the ctor. BUG=615288 Committed: https://crrev.com/35c9e62b75248238526386edc44c46794adac095 Cr-Commit-Position: refs/heads/master@{#396961}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -5 lines) Patch
M remoting/client/jni/chromoting_jni_instance.h View 1 chunk +3 lines, -0 lines 0 comments Download
M remoting/client/jni/chromoting_jni_instance.cc View 2 chunks +10 lines, -5 lines 0 comments Download
M remoting/client/jni/chromoting_jni_runtime.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
Yuwei
PTAL
4 years, 6 months ago (2016-05-31 21:26:35 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2023113002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2023113002/1
4 years, 6 months ago (2016-05-31 21:29:08 UTC) #4
Lambros
lgtm
4 years, 6 months ago (2016-05-31 21:43:11 UTC) #5
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-05-31 22:40:27 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2023113002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2023113002/1
4 years, 6 months ago (2016-05-31 22:46:09 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 6 months ago (2016-05-31 22:51:07 UTC) #10
commit-bot: I haz the power
4 years, 6 months ago (2016-05-31 22:52:07 UTC) #12
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/35c9e62b75248238526386edc44c46794adac095
Cr-Commit-Position: refs/heads/master@{#396961}

Powered by Google App Engine
This is Rietveld 408576698