closes a potential race between pipe creation and
RGWHTTPManager::reqs_thread_entry()'s access of thread_pipe
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit
9161e9fdbfb2aa529a87197ef1a34f03917b80d9)
int RGWHTTPManager::set_threaded()
{
- is_threaded = true;
- reqs_thread = new ReqsThread(this);
- reqs_thread->create("http_manager");
-
int r = pipe(thread_pipe);
if (r < 0) {
r = -errno;
ldout(cct, 0) << "ERROR: pipe() returned errno=" << r << dendl;
return r;
}
+
+ is_threaded = true;
+ reqs_thread = new ReqsThread(this);
+ reqs_thread->create("http_manager");
return 0;
}