tryinf to presere sanirty
This commit is contained in:
4
main.cpp
4
main.cpp
@@ -71,7 +71,9 @@ void sensorsThread(std::stop_token st, Sensors* s) {
|
||||
while (!st.stop_requested()) {
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s->mtx); // will unlock when it goes out of scope, this is why this whole thing is in braces
|
||||
// this will unlock when program goes out of scope
|
||||
std::lock_guard<std::mutex> lock(s->mtx);
|
||||
// maybe make these take pointers too
|
||||
s->td = getTimeDate();
|
||||
s->loadavg = getAvgs();
|
||||
s->ram = getRam();
|
||||
|
||||
Reference in New Issue
Block a user