Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Concurrent read/write #126

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions include/sdsl/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INCLUDED_SDSL_UTIL

#include <algorithm>
#include <atomic>
#include <cassert>
#include <chrono>
#include <cstdlib>
Expand Down Expand Up @@ -345,15 +346,10 @@ inline char * str_from_errno()
#endif
}

struct _id_helper_struct
inline uint64_t _id_helper()
{
uint64_t id = 0;
};

extern inline uint64_t _id_helper()
{
static _id_helper_struct data;
return data.id++;
static std::atomic<uint64_t> id{0u};
return id++;
}

//! Get the process id of the current process
Expand Down
Loading