From 8ca1d278755591c0e1a67591fe49101898dc71ae Mon Sep 17 00:00:00 2001 From: "Oleg.Korshul" Date: Fri, 28 Mar 2014 07:43:42 +0000 Subject: [PATCH] git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55201 954022d7-b5bf-4e40-9824-e11837661b57 --- DesktopEditor/graphics/BaseThread.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DesktopEditor/graphics/BaseThread.h b/DesktopEditor/graphics/BaseThread.h index ee602e869d..0711657287 100644 --- a/DesktopEditor/graphics/BaseThread.h +++ b/DesktopEditor/graphics/BaseThread.h @@ -1,4 +1,4 @@ -#ifndef _BUILD_BASETHREAD_H_ +#ifndef _BUILD_BASETHREAD_H_ #define _BUILD_BASETHREAD_H_ #include "../common/Types.h" @@ -31,8 +31,8 @@ namespace NSThreads ::Sleep((DWORD)nMilliseconds); #else struct timespec tim, tim2; - tim.tv_sec = 1; - tim.tv_nsec = nMilliseconds * 1000000; + tim.tv_sec = nMilliseconds / 1000; + tim.tv_nsec = (nMilliseconds % 1000) * 1000000; ::nanosleep(&tim , &tim2); #endif @@ -72,13 +72,13 @@ namespace NSThreads m_hThread = new __native_thread(); + m_bRunThread = TRUE; #if defined(WIN32) || defined(_WIN32_WCE) - DWORD dwTemp; - m_bRunThread = TRUE; + DWORD dwTemp; ((__native_thread*)m_hThread)->m_thread = CreateThread(NULL, 0, &__ThreadProc, (void*)this, 0, &dwTemp); SetThreadPriority(((__native_thread*)m_hThread)->m_thread, lPriority); #else - pthread_create(&((__native_thread*)m_hThread)->m_thread, 0, &__ThreadProc), (void*)this); + pthread_create(&((__native_thread*)m_hThread)->m_thread, 0, &__ThreadProc, (void*)this); #endif m_lThreadPriority = lPriority; } @@ -152,7 +152,7 @@ namespace NSThreads } }; #else - static void __ThreadProc(void* pv) + static void* __ThreadProc(void* pv) { int old_thread_type; pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old_thread_type); @@ -179,4 +179,4 @@ namespace NSThreads }; } -#endif // _BUILD_BASETHREAD_H_ \ No newline at end of file +#endif // _BUILD_BASETHREAD_H_