mirror of
https://github.com/ceph/ceph
synced 2025-01-11 21:50:26 +00:00
msg/DispachQueue: hold lock in IncomingQueue::discard_queue()
This prevents races with the dispatch thread, among other things. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
35b7bca357
commit
5a62dfef3d
@ -92,6 +92,8 @@ void IncomingQueue::discard_queue()
|
||||
|
||||
// dequeue ourselves
|
||||
dq->lock.Lock();
|
||||
lock.Lock();
|
||||
|
||||
for (map<int, xlist<IncomingQueue *>::item* >::iterator i = queue_items.begin();
|
||||
i != queue_items.end();
|
||||
++i) {
|
||||
@ -125,6 +127,8 @@ void IncomingQueue::discard_queue()
|
||||
}
|
||||
in_q.clear();
|
||||
in_qlen = 0;
|
||||
|
||||
lock.Unlock();
|
||||
}
|
||||
|
||||
void IncomingQueue::restart_queue()
|
||||
|
Loading…
Reference in New Issue
Block a user