提交 ed4e0290 编写于 作者: M Matt Pharr

Use mutex in ElapsedSeconds() to protect static variable.

Given C++'s rules for initialization of statics, I don't think this is
strictly necessary, but it makes helgrind happy and causes no harm.
上级 21115e81
......@@ -50,6 +50,9 @@ namespace pbrt {
namespace {
float ElapsedSeconds() {
static std::mutex mutex;
std::lock_guard<std::mutex> lock(mutex);
using clock = std::chrono::steady_clock;
static clock::time_point start = clock::now();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册