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 2029103002: Fix bug of posting task inside constructor (Closed)

Created:
4 years, 6 months ago by Lambros
Modified:
4 years, 6 months ago
Reviewers:
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2743
Target Ref:
refs/pending/branch-heads/2743
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 Review-Url: https://codereview.chromium.org/2023113002 Cr-Commit-Position: refs/heads/master@{#396961} (cherry picked from commit 35c9e62b75248238526386edc44c46794adac095) Committed: https://chromium.googlesource.com/chromium/src/+/c6ab1822890f8eebdf8aca40a26b4715518a4767

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: 2 (1 generated)
Lambros
4 years, 6 months ago (2016-06-01 17:15:21 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
c6ab1822890f8eebdf8aca40a26b4715518a4767.

Powered by Google App Engine
This is Rietveld 408576698