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

Issue 999002: Ensure that an autorelease pool is available in worker_pool_mac's WorkerPool::PostTask (Closed)

Created:
10 years, 9 months ago by Mark Mentovai
Modified:
9 years, 7 months ago
CC:
chromium-reviews, John Grabowski, pam+watch_chromium.org, brettw+cc_chromium.org
Visibility:
Public.

Description

Ensure that an autorelease pool is available in worker_pool_mac's WorkerPool::PostTask. BUG=38357, 20471 (but probably only peripherally) TEST=no messages from __NSAutoreleaseNoPool() at launch Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=41871

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -14 lines) Patch
M base/worker_pool_mac.mm View 1 chunk +2 lines, -0 lines 0 comments Download
M tools/valgrind/memcheck/suppressions_mac.txt View 1 chunk +0 lines, -14 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Mark Mentovai
10 years, 9 months ago (2010-03-16 22:16:31 UTC) #1
Mark Mentovai
10 years, 9 months ago (2010-03-17 14:44:23 UTC) #2
Scott Hess - ex-Googler
LGTM. I was thinking more like: scoped_nsobject<TaskOperation> op([[TaskOperation alloc] initWithTask:task]); [operation_queue addOperation:op]; [and get rid ...
10 years, 9 months ago (2010-03-17 17:47:27 UTC) #3
Mark Mentovai
shess@chromium.org wrote: > I was thinking more like: > scoped_nsobject<TaskOperation> op([[TaskOperation alloc] > initWithTask:task]); > ...
10 years, 9 months ago (2010-03-17 19:00:33 UTC) #4
Scott Hess - ex-Googler
10 years, 9 months ago (2010-03-17 19:02:49 UTC) #5
anyhow, lgtm.

On Wed, Mar 17, 2010 at 12:00 PM, Mark Mentovai <mark@chromium.org> wrote:
> shess@chromium.org wrote:
>> I was thinking more like:
>>  scoped_nsobject<TaskOperation> op([[TaskOperation alloc]
>> initWithTask:task]);
>>  [operation_queue addOperation:op];
>> [and get rid of +taskOperationWithTask: entirely], but I'm not entirely
>> certain
>> this couldn't still need a pool for creating the singleton, so that might
>> not be
>> complete.
>
> It's incomplete, not because of the singleton, but because NSOperation
> (TaskOperation's superclass) autoreleases things in its own -init.
> You can see this happening in bug 20471 comment 83.
>
>> I feel icky that tasks posted via WorkerPool will run w/in an autorelease
>> pool,
>> but there may have been no autorelease pool when the task was posted.
>
> You're giving a task to a completely different thread to run for you.
> I don't think it's bad to have the autorelease pool in -main.  I don't
> think that this is really relevant to the pool that I'm adding in
> PostTask, either.
>
>> It
>> feels
>> like a subtle violation of some contract which will someday bite us when
>> someone
>> comes along to refactor or something.  But I'm not sure what to do about it.
>
> Something's always gotta bite...
>
> Mark
>

Powered by Google App Engine
This is Rietveld 408576698