diff options
author | chao.bi <chao.bi@intel.com> | 2016-03-16 00:12:24 +0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2016-04-14 00:49:56 -0700 |
commit | 7a8a51b231b4aea8dd9db1b7aece3d71c875d731 (patch) | |
tree | d4d9c250cc51b67c260e0ed00a268935a51d21a7 /CleanSpec.mk | |
parent | 15e7a21560764d644673854894eefbcd759d420a (diff) | |
download | frameworks_base-7a8a51b231b4aea8dd9db1b7aece3d71c875d731.zip frameworks_base-7a8a51b231b4aea8dd9db1b7aece3d71c875d731.tar.gz frameworks_base-7a8a51b231b4aea8dd9db1b7aece3d71c875d731.tar.bz2 |
Race in WapPushManager under multi-thread environment
When multiple threads call WapPushManager functions simultaneously,
it might hit race that one thread is closing a SqliteDatabase object
while another thread is using it.
Following is an example:
Thread A Thread B
call getDatabaseLocked() ---
| |
mDatabase is NULL,so A create Database ---
| |
getDatabaseLocked() return the new ---
created Database ---
| |
--- call getDatabaseLocked() and return
--- the Database created by A
| |
Call SQLiteDatabase.close() ---
close() -> releaseReference() ---
the reference count is decreased to 0 ---
| |
--- Attempt to call any operation of Database
--- Object, but hit exception because this
--- Database Object's reference count is 0
For WapPushManager, seems it always close the database object right after
it open&query it, this is not necessary and would hit above race under multi-thread
environment.
Change-Id: I68fac046f806c8d9328fbe0d9c8a08e6bfddbef1
Signed-off-by: wangbo3 <bo.c.wang@intel.com>
Signed-off-by: chao.bi <chao.bi@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
Diffstat (limited to 'CleanSpec.mk')
0 files changed, 0 insertions, 0 deletions