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