Alonzo Altamirano
Alonzo Altamirano

Reputation: 23

Is std::chrono::time_point thread safe?

I have a std::chrono::time_point<std::chrono::steady_clock> variable that I am modifying across threads, is this variable thread safe? If not, I intend to make it atomic.

Upvotes: 1

Views: 926

Answers (1)

eerorika
eerorika

Reputation: 238391

I have a std::chrono::time_point<std::chrono::steady_clock> variable that I am modifying across threads, is this variable thread safe?

No. std::chrono::time_point<std::chrono::steady_clock> is not guaranteed to be thread safe.

Upvotes: 4

Related Questions