Added volatile into a variable, based on advice from andyhhp from SRCF.
[22:40] <andyhhp> curl_process_msgs()'s use of "static int slept" is dangerous and racy. an optimising compiler can and probably will do bad things [22:45] <ff266> with respect to "static int slept", should i just put a volatile in front of it? So "volatile static int slept"? [22:46] <ff266> I meant "static volatile int slept;" [22:47] <andyhhp> lets say yes for the sake of argument [22:47] <andyhhp> "its complicated" [22:47] <andyhhp> but that will broadly do what you want
This commit is contained in:
parent
79004cb7ee
commit
aa4aae58b2
|
@ -107,7 +107,7 @@ static void curl_process_msgs(CURLMsg *curl_msg, int n_running_curl,
|
|||
{
|
||||
(void) n_running_curl;
|
||||
(void) n_mesgs;
|
||||
static int slept = 0;
|
||||
static volatile int slept = 0;
|
||||
if (curl_msg->msg == CURLMSG_DONE) {
|
||||
TransferStruct *transfer;
|
||||
CURL *curl = curl_msg->easy_handle;
|
||||
|
|
Loading…
Reference in New Issue