Bug 232070

Summary: StreamConnectionWorkQueue::processStreams() has a incorrect protection ref
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebKit2Assignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED FIXED    
Severity: Normal CC: kkinnunen, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Kimmo Kinnunen 2021-10-21 01:40:33 PDT
`StreamConnectionWorkQueue::processStreams()` has a incorrect protection ref

The `processStreams()` runs in the work queue thread.
It cannot hold the last ref of itself, as that would mean that it would destroy itself in the thread it runs.
This is not possible.
Comment 1 Kimmo Kinnunen 2021-10-21 01:51:34 PDT
Created attachment 441997 [details]
Patch
Comment 2 Wenson Hsieh 2021-10-21 08:27:16 PDT
Comment on attachment 441997 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441997&action=review

> Source/WebKit/ChangeLog:12
> +        task, and since `stop()` waits until queue has executed the

In that case, I think we should consider renaming `stop()` to `stopAndWaitForTasksToComplete()`, to make it clear that it must always block on the work queue thread.
Comment 3 Kimmo Kinnunen 2021-10-22 01:53:13 PDT
Created attachment 442134 [details]
Patch for landing
Comment 4 Kimmo Kinnunen 2021-10-22 07:02:55 PDT
(In reply to Wenson Hsieh from comment #2)
> Comment on attachment 441997 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=441997&action=review
> 
> > Source/WebKit/ChangeLog:12
> > +        task, and since `stop()` waits until queue has executed the
> 
> In that case, I think we should consider renaming `stop()` to
> `stopAndWaitForTasksToComplete()`, to make it clear that it must always
> block on the work queue thread.

Thanks, added it as stopAndWaitForCompletion to use same naming as Thread
Comment 5 EWS 2021-10-22 07:38:49 PDT
Committed r284681 (243401@main): <https://commits.webkit.org/243401@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442134 [details].
Comment 6 Radar WebKit Bug Importer 2021-10-22 07:39:14 PDT
<rdar://problem/84549004>