DescriptionFix 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 #
Messages
Total messages: 12 (5 generated)
|