mirror of https://github.com/tp4a/teleport
Fix builder script for Linux.
parent
f26c71d52d
commit
c2cf5b1842
|
@ -15,7 +15,7 @@
|
|||
# for CMake
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
cmake-build-*
|
||||
cmake-build*
|
||||
# cmake-build-debug
|
||||
client/tp_assist_macos/build
|
||||
**/xcode_build
|
||||
|
|
|
@ -91,9 +91,11 @@ class BuilderLinux(BuilderBase):
|
|||
|
||||
utils.makedirs(out_path)
|
||||
|
||||
build_path = os.path.join(env.root_path, 'cmake-build-linux')
|
||||
if not os.path.exists(build_path):
|
||||
utils.makedirs(build_path)
|
||||
# build_path = os.path.join(env.root_path, 'cmake-build-linux')
|
||||
# if not os.path.exists(build_path):
|
||||
# utils.makedirs(build_path)
|
||||
|
||||
utils.cmake(os.path.join(env.root_path, 'cmake-build-linux'), ctx.target_path, False)
|
||||
|
||||
# old_p = os.getcwd()
|
||||
# os.chdir(build_path)
|
||||
|
|
|
@ -8,12 +8,20 @@
|
|||
#ifdef EX_OS_WIN32
|
||||
# include <process.h>
|
||||
typedef HANDLE EX_THREAD_HANDLE;
|
||||
# define EX_THREAD_NULL NULL
|
||||
#else
|
||||
|
||||
# include <pthread.h>
|
||||
# include <sys/time.h>
|
||||
|
||||
typedef pthread_t EX_THREAD_HANDLE;
|
||||
|
||||
# if defined(EX_OS_LINUX)
|
||||
# define EX_THREAD_NULL 0
|
||||
# elif defined(EX_OS_MACOS)
|
||||
# define EX_THREAD_NULL nullptr
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
class ExThreadBase
|
||||
|
|
|
@ -18,7 +18,7 @@ void *ExThreadBase::_thread_func(void *pParam)
|
|||
_this->m_is_running = true;
|
||||
_this->_thread_loop();
|
||||
_this->m_is_running = false;
|
||||
_this->m_handle = nullptr;
|
||||
_this->m_handle = EX_THREAD_NULL;
|
||||
|
||||
_this->_on_stopped();
|
||||
EXLOGV("[thread] - `%s` exit.\n", _this->m_thread_name.c_str());
|
||||
|
@ -26,7 +26,7 @@ void *ExThreadBase::_thread_func(void *pParam)
|
|||
}
|
||||
|
||||
ExThreadBase::ExThreadBase(const char *thread_name) :
|
||||
m_handle(0),
|
||||
m_handle(EX_THREAD_NULL),
|
||||
m_is_running(false),
|
||||
m_need_stop(false) {
|
||||
m_thread_name = thread_name;
|
||||
|
@ -50,7 +50,7 @@ bool ExThreadBase::start() {
|
|||
}
|
||||
m_handle = h;
|
||||
#else
|
||||
pthread_t tid = nullptr;
|
||||
pthread_t tid = EX_THREAD_NULL;
|
||||
int ret = pthread_create(&tid, nullptr, _thread_func, (void *) this);
|
||||
if (ret != 0) {
|
||||
return false;
|
||||
|
@ -63,7 +63,7 @@ bool ExThreadBase::start() {
|
|||
}
|
||||
|
||||
bool ExThreadBase::stop() {
|
||||
if (m_handle == 0) {
|
||||
if (m_handle == EX_THREAD_NULL) {
|
||||
EXLOGW("[thread] `%s` already stopped before stop() call.\n", m_thread_name.c_str());
|
||||
return true;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ bool ExThreadBase::stop() {
|
|||
}
|
||||
}
|
||||
#else
|
||||
if(m_handle != 0) {
|
||||
if(m_handle != EX_THREAD_NULL) {
|
||||
if (pthread_join(m_handle, nullptr) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue