output/httpd: move Bind()/Unbind() to the IOThread
Fixes more thread-safety bugs.
This commit is contained in:
parent
880bf17dae
commit
bfe7533546
@ -71,8 +71,11 @@ HttpdOutput::Bind(Error &error)
|
||||
{
|
||||
open = false;
|
||||
|
||||
const ScopeLock protect(mutex);
|
||||
return ServerSocket::Open(error);
|
||||
bool result = false;
|
||||
BlockingCall(DeferredMonitor::GetEventLoop(), [this, &error, &result](){
|
||||
result = ServerSocket::Open(error);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
inline void
|
||||
@ -80,8 +83,9 @@ HttpdOutput::Unbind()
|
||||
{
|
||||
assert(!open);
|
||||
|
||||
const ScopeLock protect(mutex);
|
||||
ServerSocket::Close();
|
||||
BlockingCall(DeferredMonitor::GetEventLoop(), [this](){
|
||||
ServerSocket::Close();
|
||||
});
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user