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