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

Issue 925513002: Removed unnecessary potential locking (Closed)

Created:
5 years, 10 months ago by ripp
Modified:
5 years, 10 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Removed unnecessary potential locking Function isInitialized, unlike calls ensureinitialized should not block the thread, but it will if initialization is in progress at this moment. It is not necessery to synchronize the sInitialized flag in isInitialized function. It is enough that flag have a primitive type and has a volatile qualifier. R=nyquist@chromium.org, rmcilroy@chromium.org TEST=It is rather hard to test. We've found ~300ms stuck on UI thread, on calling LibraryLoader.isInitialized from ContentApplication.onCreate with profiler Committed: https://crrev.com/e1d5ac1d7c0a594f0c218c7031095ad684cc56df Cr-Commit-Position: refs/heads/master@{#318208}

Patch Set 1 #

Patch Set 2 : Rebased to fresh master, resolved conflicts #

Patch Set 3 : Removed unused function GetLibraryProcessType #

Patch Set 4 : Removed redundant qualifier #

Patch Set 5 : Qualifier restored #

Patch Set 6 : GetLibraryProcessType returned. mLibraryProcessType made volatile #

Total comments: 2

Patch Set 7 : volatile changed to final for mLibraryProcessType #

Total comments: 4

Patch Set 8 : Comments added #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -14 lines) Patch
M base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java View 1 2 3 4 5 6 7 7 chunks +17 lines, -14 lines 0 comments Download

Messages

Total messages: 30 (7 generated)
ripp
5 years, 10 months ago (2015-02-12 13:52:55 UTC) #1
rmcilroy
+simonb who knows this code better than me.
5 years, 10 months ago (2015-02-12 17:31:27 UTC) #3
nyquist
lgtm
5 years, 10 months ago (2015-02-18 19:44:42 UTC) #4
simonb (inactive)
lgtm
5 years, 10 months ago (2015-02-19 11:07:29 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/925513002/1
5 years, 10 months ago (2015-02-19 11:11:28 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: ios_rel_device_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ng/builds/12417)
5 years, 10 months ago (2015-02-19 11:13:55 UTC) #9
ripp
LibraryLoader now become singleton. Since it is never destroyed it is safe to make it ...
5 years, 10 months ago (2015-02-20 07:23:08 UTC) #11
rmcilroy
On 2015/02/20 07:23:08, ripp wrote: > LibraryLoader now become singleton. Since it is never destroyed ...
5 years, 10 months ago (2015-02-20 10:43:09 UTC) #12
ripp
On 2015/02/20 10:43:09, rmcilroy wrote: > On 2015/02/20 07:23:08, ripp wrote: > > LibraryLoader now ...
5 years, 10 months ago (2015-02-20 11:22:30 UTC) #13
rmcilroy
On 2015/02/20 11:22:30, ripp wrote: > On 2015/02/20 10:43:09, rmcilroy wrote: > > On 2015/02/20 ...
5 years, 10 months ago (2015-02-20 11:39:15 UTC) #14
ripp
Ok, I've removed GetLibraryProcessType
5 years, 10 months ago (2015-02-20 12:39:00 UTC) #15
ripp
Sorry about two last patch sets - too carried away :)
5 years, 10 months ago (2015-02-20 12:41:39 UTC) #16
rmcilroy
Sorry, I just noticed that the GetLibraryProcessType() was only add a week ago. Michael / ...
5 years, 10 months ago (2015-02-20 17:35:40 UTC) #18
michaelbai
On 2015/02/20 17:35:40, rmcilroy wrote: > Sorry, I just noticed that the GetLibraryProcessType() was only ...
5 years, 10 months ago (2015-02-20 18:10:12 UTC) #19
michaelbai
On 2015/02/20 17:35:40, rmcilroy wrote: > Sorry, I just noticed that the GetLibraryProcessType() was only ...
5 years, 10 months ago (2015-02-20 18:10:55 UTC) #20
ripp
I've restored GetLibraryProcessType and made mLibraryProcessType volatile
5 years, 10 months ago (2015-02-24 11:58:23 UTC) #21
michaelbai
https://codereview.chromium.org/925513002/diff/100001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java File base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java (right): https://codereview.chromium.org/925513002/diff/100001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java#newcode84 base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java:84: private volatile int mLibraryProcessType; You probably should use final ...
5 years, 10 months ago (2015-02-25 04:57:12 UTC) #22
ripp
https://codereview.chromium.org/925513002/diff/100001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java File base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java (right): https://codereview.chromium.org/925513002/diff/100001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java#newcode84 base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java:84: private volatile int mLibraryProcessType; On 2015/02/25 04:57:12, michaelbai wrote: ...
5 years, 10 months ago (2015-02-25 08:32:23 UTC) #23
rmcilroy
lgtm once comments are added. https://codereview.chromium.org/925513002/diff/120001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java File base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java (right): https://codereview.chromium.org/925513002/diff/120001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java#newcode57 base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java:57: private volatile boolean mInitialized; ...
5 years, 10 months ago (2015-02-25 14:10:20 UTC) #24
ripp
https://codereview.chromium.org/925513002/diff/120001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java File base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java (right): https://codereview.chromium.org/925513002/diff/120001/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java#newcode57 base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java:57: private volatile boolean mInitialized; On 2015/02/25 14:10:20, rmcilroy wrote: ...
5 years, 10 months ago (2015-02-25 15:36:26 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/925513002/140001
5 years, 10 months ago (2015-02-26 07:12:37 UTC) #28
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 10 months ago (2015-02-26 08:07:57 UTC) #29
commit-bot: I haz the power
5 years, 10 months ago (2015-02-26 08:08:44 UTC) #30
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/e1d5ac1d7c0a594f0c218c7031095ad684cc56df
Cr-Commit-Position: refs/heads/master@{#318208}

Powered by Google App Engine
This is Rietveld 408576698