Skip to content

Commit

Permalink
[messaging] profiling instrumentation on message passer/receiver lock…
Browse files Browse the repository at this point in the history
…s. should help identify lock contention
  • Loading branch information
harrand committed Jan 30, 2024
1 parent 045fdb2 commit 9240102
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tz/core/messaging.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef TOPAZ_CORE_MESSAGING_HPP
#define TOPAZ_CORE_MESSAGING_HPP
#include "tz/core/types.hpp"
#include "tz/core/profile.hpp"
#include <vector>
#include <mutex>
#include <ranges>
Expand All @@ -26,7 +27,11 @@ namespace tz
protected:
mutable std::mutex mtx = {};
using lock_t = std::unique_lock<std::mutex>;
lock_t lock() const {return lock_t{this->mtx};}
lock_t lock() const
{
TZ_PROFZONE("message receiver - lock", 0xFFCCAACC);
return lock_t{this->mtx};
}
};
}

Expand Down

0 comments on commit 9240102

Please sign in to comment.