diff options
author | Frédéric Brière <fbriere@fbriere.net> | 2019-12-27 02:26:38 -0500 |
---|---|---|
committer | Frédéric Brière <fbriere@fbriere.net> | 2019-12-27 02:28:05 -0500 |
commit | 91de36717a119f9501698af97550bfcdffd2875a (patch) | |
tree | 077f6a77d25d3c19935da32ab5dabec0a417e0c9 /src/userintf.h | |
parent | 3d126cd9a7f9029e199e9220e2ffa08ac4e23227 (diff) | |
download | twinkle-91de36717a119f9501698af97550bfcdffd2875a.tar twinkle-91de36717a119f9501698af97550bfcdffd2875a.tar.gz twinkle-91de36717a119f9501698af97550bfcdffd2875a.tar.lz twinkle-91de36717a119f9501698af97550bfcdffd2875a.tar.xz twinkle-91de36717a119f9501698af97550bfcdffd2875a.zip |
Introduce read-write-update locks and guards to prevent deadlocks
This converts t_rwmutex and t_rwmutex_guard into a read-write-update[*]
lock and guard, in an attempt to circumvent the various deadlocks that
were introduced with the addition of lines_mtx in 38bb6b7.
[*] For more details, see https://stackoverflow.com/a/18785300 and
http://lkml.iu.edu/hypermail/linux/kernel/0004.3/0117.html.
Note that this is not a real fix; this would require analyzing and
refactoring phone.cpp, which is well beyond my abilities. This is at
best a workaround that appears to conveniently dodge all the deadlocks
I've encountered so far.
(It would have been more proper to introduce a separate class for this
purpose, but this would have required modifying over 80 lines just to
change one type for another. As phone_users_mtx is the only other
instance of this class, the impact of subverting t_rwmutex directly is
minimal.)
Diffstat (limited to 'src/userintf.h')
0 files changed, 0 insertions, 0 deletions