diff options
author | Simon Rettberg | 2019-08-07 17:11:51 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-08-07 17:11:51 +0200 |
commit | be7d7d95850c30a154aaa56e95d6a7f36793409d (patch) | |
tree | 53bcae440652076d53cb01bfb7ee73fc2d868283 /LOCKS | |
parent | [SERVER] Lock-free queue for altservers check thread (diff) | |
download | dnbd3-be7d7d95850c30a154aaa56e95d6a7f36793409d.tar.gz dnbd3-be7d7d95850c30a154aaa56e95d6a7f36793409d.tar.xz dnbd3-be7d7d95850c30a154aaa56e95d6a7f36793409d.zip |
[SERVER] Better lock debugging: Always check lock order
Lock order is predefined in locks.h. Immediately bail out if a lock with
lower priority is obtained while the same thread already holds one with
higher priority.
Diffstat (limited to 'LOCKS')
-rw-r--r-- | LOCKS | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -16,23 +16,22 @@ requests.lock ===== SERVER ===== This is a list of used locks, in the order they -have to be aquired if you must hold multiple locks: -remoteCloneLock | reloadLock +have to be aquired if you must hold multiple locks. +Note this list might be out of date, take a look at the +defines in lock.h for the effective order. +reloadLock +remoteCloneLock _clients_lock _clients[].lock integrityQueueLock _images_lock _images[].lock -pendingLockConsume -pendingLockProduce uplink.queueLock altServersLock client.sendMutex -client.statsLock -statisticsSentLock -statisticsReceivedLock uplink.rttLock uplink.sendMutex +aclLock If you need to lock multiple clients/images/... at once, lock the client with the lowest array index first. |