The cond is signaled in RGWHTTPManager's thread, which is
different with the thread executing wait(), so there is a
race condition.
Signed-off-by: cfanz <songxinyingftd@gmail.com>
int wait() {
Mutex::Locker l(lock);
+ if (done) {
+ return ret;
+ }
cond.Wait(lock);
return ret;
}
*/
int RGWHTTPClient::wait()
{
- if (!req_data->is_done()) {
- return req_data->wait();
- }
-
- return req_data->ret;
+ return req_data->wait();
}
RGWHTTPClient::~RGWHTTPClient()