Skip to content

Commit

Permalink
common/TrackedOp: Should lock ops_history_lock when access shutdown.
Browse files Browse the repository at this point in the history
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit 7fe72a2)
  • Loading branch information
majianpeng authored and dzafman committed Jul 11, 2016
1 parent f0b8755 commit 2dc0963
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/common/TrackedOp.cc
Expand Up @@ -38,10 +38,9 @@ void OpHistory::on_shutdown()

void OpHistory::insert(utime_t now, TrackedOpRef op)
{
Mutex::Locker history_lock(ops_history_lock);
if (shutdown)
return;

Mutex::Locker history_lock(ops_history_lock);
duration.insert(make_pair(op->get_duration(), op));
arrived.insert(make_pair(op->get_initiated(), op));
cleanup(now);
Expand Down

0 comments on commit 2dc0963

Please sign in to comment.