Merge branch 'feature/mstsc' of github.com:tp4a/teleport into feature/mstsc

pull/236/head
Apex Liu 2019-11-28 12:26:18 +08:00
commit bfd8ef11e9
2 changed files with 8 additions and 5 deletions

View File

@ -75,9 +75,10 @@ bool ExThreadBase::stop(void) {
EXLOGV("[thread] wait thread [%s] exit.\n", m_thread_name.c_str()); EXLOGV("[thread] wait thread [%s] exit.\n", m_thread_name.c_str());
#ifdef EX_OS_WIN32 #ifdef EX_OS_WIN32
if (WaitForSingleObject(m_handle, INFINITE) != WAIT_OBJECT_0) if (m_handle) {
{ if (WaitForSingleObject(m_handle, INFINITE) != WAIT_OBJECT_0) {
return false; return false;
}
} }
#else #else
if(m_handle != 0) { if(m_handle != 0) {

View File

@ -160,8 +160,10 @@ def tp_second2human(n):
return ret return ret
def tp_timestamp_from_str(t): def tp_timestamp_from_str(t, fmt='%Y-%m-%d %H:%M:%S'):
return 0 _fmt = '%Y-%m-%d %H:%M:%S' if fmt is None else fmt
d = datetime.datetime.strptime(t, _fmt)
return int(d.timestamp())
def tp_timestamp_sec(): def tp_timestamp_sec():