Skip to content

Commit

Permalink
Ensure atomic updates to Last_flush_time_msec
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowe committed May 24, 2024
1 parent 921b1be commit ad1959e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/cpp/profiler/ProfilerJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <string.h>
#include <time.h>

#include <atomic>
#include <condition_variable>
#include <iostream>
#include <mutex>
Expand Down Expand Up @@ -206,7 +207,7 @@ struct subscriber_state {
// Global variables
subscriber_state* State = nullptr;
uint64_t Flush_period_msec;
uint64_t Last_flush_time_msec;
std::atomic_uint64_t Last_flush_time_msec;

JavaVM* get_jvm(JNIEnv* env)
{
Expand Down

0 comments on commit ad1959e

Please sign in to comment.