diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-11-29 15:36:57 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-03 22:10:55 -0600 |
commit | bc74922ab1ed025bf8216b49fb7b214d74de087a (patch) | |
tree | 9004aaf6cba4ccde8494e304430142c582e62dee | |
parent | 1486a08de557b8f237a066a57cc2c74961ba36e0 (diff) | |
download | skiboot-bc74922ab1ed025bf8216b49fb7b214d74de087a.zip skiboot-bc74922ab1ed025bf8216b49fb7b214d74de087a.tar.gz skiboot-bc74922ab1ed025bf8216b49fb7b214d74de087a.tar.bz2 |
core/lock: improve bust_locks
Prevent try_lock from modifying the lock state when bust_locks is set.
unlock will not unlock it in that case, so locks will get taken and
never released while bust_locks is set.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/lock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/lock.c b/core/lock.c index 916a024..b5e3323 100644 --- a/core/lock.c +++ b/core/lock.c @@ -93,6 +93,9 @@ bool try_lock(struct lock *l) { struct cpu_thread *cpu = this_cpu(); + if (bust_locks) + return true; + if (__try_lock(cpu, l)) { if (l->in_con_path) cpu->con_suspend++; |