[DEV] update to Web build mode

This commit is contained in:
Edouard DUPIN 2016-11-04 22:54:25 +01:00
parent dffe2a4055
commit 5c6bae6b68

View File

@ -61,7 +61,8 @@ static void setThreadName(std::thread* _thread, const std::string& _name) {
} }
g_lock.unlock(); g_lock.unlock();
// try now to set the thread name with Pthread // try now to set the thread name with Pthread
#if defined(__TARGET_OS__Linux) #if defined(__TARGET_OS__Linux) \
&& !defined(__TARGET_OS__Web)
pthread_t pthreadID; pthread_t pthreadID;
if (_thread == nullptr) { if (_thread == nullptr) {
pthreadID = pthread_self(); pthreadID = pthread_self();
@ -104,7 +105,8 @@ std::string ethread::getName(std::thread& _thread) {
return getThreadName(_thread.get_id()); return getThreadName(_thread.get_id());
} }
#if defined(__TARGET_OS__Linux) #if defined(__TARGET_OS__Linux) \
&& !defined(__TARGET_OS__Web)
static void setThreadPriority(pthread_t _threadID, int32_t _priority) { static void setThreadPriority(pthread_t _threadID, int32_t _priority) {
int retcode; int retcode;
int policy; int policy;
@ -148,21 +150,24 @@ std::string ethread::getName(std::thread& _thread) {
void ethread::setPriority(int32_t _priority) { void ethread::setPriority(int32_t _priority) {
#if defined(__TARGET_OS__Linux) #if defined(__TARGET_OS__Linux) \
&& !defined(__TARGET_OS__Web)
pthread_t threadID = pthread_self(); pthread_t threadID = pthread_self();
setThreadPriority(threadID, _priority); setThreadPriority(threadID, _priority);
#endif #endif
} }
void ethread::setPriority(std::thread& _thread, int32_t _priority) { void ethread::setPriority(std::thread& _thread, int32_t _priority) {
#if defined(__TARGET_OS__Linux) #if defined(__TARGET_OS__Linux) \
&& !defined(__TARGET_OS__Web)
pthread_t threadID = (pthread_t) _thread.native_handle(); pthread_t threadID = (pthread_t) _thread.native_handle();
setThreadPriority(threadID, _priority); setThreadPriority(threadID, _priority);
#endif #endif
} }
int32_t ethread::getPriority() { int32_t ethread::getPriority() {
#if defined(__TARGET_OS__Linux) #if defined(__TARGET_OS__Linux) \
&& !defined(__TARGET_OS__Web)
pthread_t threadID = pthread_self(); pthread_t threadID = pthread_self();
return getThreadPriority(threadID); return getThreadPriority(threadID);
#else #else
@ -171,7 +176,8 @@ int32_t ethread::getPriority() {
} }
int32_t ethread::getPriority(std::thread& _thread) { int32_t ethread::getPriority(std::thread& _thread) {
#if defined(__TARGET_OS__Linux) #if defined(__TARGET_OS__Linux) \
&& !defined(__TARGET_OS__Web)
pthread_t threadID = static_cast<pthread_t>(_thread.native_handle()); pthread_t threadID = static_cast<pthread_t>(_thread.native_handle());
return getThreadPriority(threadID); return getThreadPriority(threadID);
#else #else