Created
July 27, 2019 17:22
-
-
Save devendranaga/eba418fe185776f0052f90fe2c9c4e37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static shared_data *shared_data::get() | |
{ | |
static shared_data sh; | |
return &sh; | |
} | |
void shared_data::put_data(T &data) | |
{ | |
std::unique_lock<std::mnutex> lock(lock); | |
data = data; | |
} | |
T &shared_data::get_data() | |
{ | |
std::unique_lock<std::mutex> lock(lock); | |
return data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment