Bug 202980 - [GTK][WPE] IconDatabase is not thread safe yet
Summary: [GTK][WPE] IconDatabase is not thread safe yet
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2019-10-15 01:47 PDT by Carlos Garcia Campos
Modified: 2019-10-21 02:21 PDT (History)
5 users (show)

See Also:


Attachments
Patch (10.81 KB, patch)
2019-10-15 01:49 PDT, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2019-10-15 01:47:48 PDT
Current implementation is safer, but we still need to protect members used by both threads.
Comment 1 Carlos Garcia Campos 2019-10-15 01:49:44 PDT
Created attachment 380970 [details]
Patch
Comment 2 EWS Watchlist 2019-10-15 01:50:26 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Adrian Perez 2019-10-21 01:40:50 PDT
Comment on attachment 380970 [details]
Patch

Patch LGTM. Given that all the uses of the database (“m_db” member)
are done in the work queue thread, maybe it would be a good thing
to add “ASSERT(!isMainThread())” at the top of helper functions
like “IconDatabase::createTablesIfNeeded()” to make it clearer that
they are not intended to be used directly from the main thread, WDYT?
Comment 4 Carlos Garcia Campos 2019-10-21 01:46:15 PDT
(In reply to Adrian Perez from comment #3)
> Comment on attachment 380970 [details]
> Patch
> 
> Patch LGTM. Given that all the uses of the database (“m_db” member)
> are done in the work queue thread, maybe it would be a good thing
> to add “ASSERT(!isMainThread())” at the top of helper functions
> like “IconDatabase::createTablesIfNeeded()” to make it clearer that
> they are not intended to be used directly from the main thread, WDYT?

Sure, I can add it.
Comment 5 Carlos Garcia Campos 2019-10-21 02:21:21 PDT
Committed r251362: <https://trac.webkit.org/changeset/251362>