If nonwait is false, another thread is waiting for complete. After calling f()
this thread will notify for finishing and at this moment another thread will
destroy this C_submit_event right now. So we may refer to nonwait when
C_submit_event is disappeared.
Fixes: http://tracker.ceph.com/issues/16714
Signed-off-by: Haomai Wang <haomai@xsky.com>
lock.lock();
cond.notify_all();
done = true;
+ bool del = nonwait;
lock.unlock();
- if (nonwait)
+ if (del)
delete this;
}
void wait() {