diff options
author | Sverker Eriksson <[email protected]> | 2011-07-06 20:39:51 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2011-07-07 17:33:05 +0200 |
commit | e683a28781caf0af79b8f076f92595927d4cd794 (patch) | |
tree | 780016f9a6f11d3064cf4e51d146e1932708374c /erts/emulator/beam/erl_db_hash.c | |
parent | 32fc16e311bfbc5abd0ab8caf64d566e1e65196d (diff) | |
download | otp-e683a28781caf0af79b8f076f92595927d4cd794.tar.gz otp-e683a28781caf0af79b8f076f92595927d4cd794.tar.bz2 otp-e683a28781caf0af79b8f076f92595927d4cd794.zip |
Fix bug in ets:delete for write_concurrency that could lead to deadlock
Relocking in ets_delete_1() and remove_named_tab() was done by
unlocking the table without clearing the is_thread_safe flag. A racing
thread could then read-lock the table and then incorrectly
write-unlock the table as db_unlock() looked at is_thread_safe to
determine which kind of lock to unlock.
Several fixes:
1. Make db_unlock() use argument 'kind' instead of is_thread_safe to
determine lock type.
2. Make relock logic use db_lock() and db_unlock() instead of directly
accessing lock primitives.
3. Do ownership transfer earlier in ets_delete_1 to avoid racing owner
process to also start deleting the same table.
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.c')
0 files changed, 0 insertions, 0 deletions