fix lua_handler core at bootstrap fail
This commit is contained in:
@ -127,8 +127,9 @@ void ObUnixDomainListener::stop()
|
|||||||
|
|
||||||
void ObUnixDomainListener::wait()
|
void ObUnixDomainListener::wait()
|
||||||
{
|
{
|
||||||
if (IS_INIT) {
|
if (IS_INIT && ATOMIC_LOAD(&running_)) {
|
||||||
worker_.join();
|
worker_.join();
|
||||||
|
ATOMIC_STORE(&running_, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +183,7 @@ int ObUnixDomainListener::run()
|
|||||||
OB_LOG(ERROR, "ObUnixDomainListener add listen to epoll failed", K(errno));
|
OB_LOG(ERROR, "ObUnixDomainListener add listen to epoll failed", K(errno));
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
} else {
|
} else {
|
||||||
ATOMIC_STORE(&stop_, false);
|
ATOMIC_STORE(&running_, true);
|
||||||
worker_ = std::thread([=]() {
|
worker_ = std::thread([=]() {
|
||||||
lib::set_thread_name("LuaHandler");
|
lib::set_thread_name("LuaHandler");
|
||||||
lib::ObStackHeaderGuard stack_header_guard;
|
lib::ObStackHeaderGuard stack_header_guard;
|
||||||
|
@ -30,7 +30,8 @@ class ObUnixDomainListener
|
|||||||
public:
|
public:
|
||||||
explicit ObUnixDomainListener()
|
explicit ObUnixDomainListener()
|
||||||
: is_inited_(false),
|
: is_inited_(false),
|
||||||
stop_(true),
|
stop_(false),
|
||||||
|
running_(false),
|
||||||
listen_fd_(-1) {}
|
listen_fd_(-1) {}
|
||||||
~ObUnixDomainListener();
|
~ObUnixDomainListener();
|
||||||
int init();
|
int init();
|
||||||
@ -43,6 +44,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
bool is_inited_;
|
bool is_inited_;
|
||||||
bool stop_;
|
bool stop_;
|
||||||
|
bool running_;
|
||||||
int listen_fd_;
|
int listen_fd_;
|
||||||
std::thread worker_;
|
std::thread worker_;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user