You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_running initialized with false,
Could there is a chance that HeartbeatClient::workLoop access the _running before the main thread has assigned true into, the heart beat thread might just stopped before the main thread has updated the value of _running.
May be we could move the assignment into thread body to avoid this issue.
void* HeartbeatClient::workLoop(void *arg) {
......
// client->_running = true; // <====== move here instead while (client->_running) {
Regards,
Alex, SourceBrella Inc.
The text was updated successfully, but these errors were encountered:
Hi,
Our code scanner has reported a data race at
workLoop
method of HeartbeatClient_running
initialized withfalse
,Could there is a chance that HeartbeatClient::workLoop access the
_running
before the main thread has assignedtrue
into, the heart beat thread might just stopped before the main thread has updated the value of_running
.May be we could move the assignment into thread body to avoid this issue.
Regards,
Alex, SourceBrella Inc.
The text was updated successfully, but these errors were encountered: