[DEV/DEBUG] No stl start to work (add manual type declaration (NO RTTI))
This commit is contained in:
parent
5be0e06356
commit
9d6f76219f
@ -7,6 +7,9 @@
|
|||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
#include <ethread/Future.hpp>
|
#include <ethread/Future.hpp>
|
||||||
|
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Future);
|
||||||
|
|
||||||
ethread::Future::Future(ememory::SharedPtr<ethread::Promise> _promise):
|
ethread::Future::Future(ememory::SharedPtr<ethread::Promise> _promise):
|
||||||
m_promise(_promise) {
|
m_promise(_promise) {
|
||||||
|
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
#include <ethread/Mutex.hpp>
|
#include <ethread/Mutex.hpp>
|
||||||
|
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Mutex);
|
||||||
|
ETK_DECLARE_TYPE(ethread::UniqueLock);
|
||||||
|
|
||||||
ethread::Mutex::Mutex() {
|
ethread::Mutex::Mutex() {
|
||||||
InitializeCriticalSection(&m_mutex);
|
InitializeCriticalSection(&m_mutex);
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,13 @@
|
|||||||
|
|
||||||
#include <etk/types.hpp>
|
#include <etk/types.hpp>
|
||||||
#include <ethread/Mutex.hpp>
|
#include <ethread/Mutex.hpp>
|
||||||
|
#include <ethread/tools.hpp>
|
||||||
|
extern "C" {
|
||||||
|
#include <errno.h>
|
||||||
|
}
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Mutex);
|
||||||
|
ETK_DECLARE_TYPE(ethread::UniqueLock);
|
||||||
//#include <ethread/debug.hpp>
|
//#include <ethread/debug.hpp>
|
||||||
|
|
||||||
ethread::Mutex::Mutex() {
|
ethread::Mutex::Mutex() {
|
||||||
@ -28,7 +35,40 @@ void ethread::Mutex::lock() {
|
|||||||
|
|
||||||
|
|
||||||
bool ethread::Mutex::tryLock() {
|
bool ethread::Mutex::tryLock() {
|
||||||
return pthread_mutex_trylock(&m_mutex) != 0;
|
int ret = pthread_mutex_trylock(&m_mutex);
|
||||||
|
if (ret == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (ret == EINVAL) {
|
||||||
|
printf("trylock error: EINVAL\n");
|
||||||
|
// The mutex was created with the protocol attribute having the value PTHREAD_PRIO_PROTECT and the calling thread's
|
||||||
|
// priority is higher than the mutex's current priority ceiling.
|
||||||
|
// The pthread_mutex_trylock() function shall fail if:
|
||||||
|
}
|
||||||
|
if (ret == EBUSY) {
|
||||||
|
printf("trylock error: EBUSY\n");
|
||||||
|
// The mutex could not be acquired because it was already locked.
|
||||||
|
// The pthread_mutex_lock(), pthread_mutex_trylock(), and pthread_mutex_unlock() functions may fail if:
|
||||||
|
}
|
||||||
|
if (ret == EINVAL) {
|
||||||
|
printf("trylock error: EINVAL\n");
|
||||||
|
// The value specified by mutex does not refer to an initialized mutex object.
|
||||||
|
}
|
||||||
|
if (ret == EAGAIN) {
|
||||||
|
printf("trylock error: EAGAIN\n");
|
||||||
|
// The mutex could not be acquired because the maximum number of recursive locks for mutex has been exceeded.
|
||||||
|
// The pthread_mutex_lock() function may fail if:
|
||||||
|
}
|
||||||
|
if (ret == EDEADLK) {
|
||||||
|
printf("trylock error: EDEADLK\n");
|
||||||
|
// The current thread already owns the mutex.
|
||||||
|
// The pthread_mutex_unlock() function may fail if:
|
||||||
|
}
|
||||||
|
if (ret == EPERM) {
|
||||||
|
printf("trylock error: EPERM\n");
|
||||||
|
//The current thread does not own the mutex.
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include <ethread/Pool.hpp>
|
#include <ethread/Pool.hpp>
|
||||||
#include <ethread/PoolExecutor.hpp>
|
#include <ethread/PoolExecutor.hpp>
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Pool);
|
||||||
|
|
||||||
ethread::Pool::Pool(uint16_t _numberOfThread):
|
ethread::Pool::Pool(uint16_t _numberOfThread):
|
||||||
m_lastTrandId(1) {
|
m_lastTrandId(1) {
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include <ethread/PoolAction.hpp>
|
#include <ethread/PoolAction.hpp>
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::PoolAction);
|
||||||
|
|
||||||
ethread::PoolAction::PoolAction(uint64_t _currentPoolId, ememory::SharedPtr<ethread::Promise> _promise, etk::Function<void()> _call) :
|
ethread::PoolAction::PoolAction(uint64_t _currentPoolId, ememory::SharedPtr<ethread::Promise> _promise, etk::Function<void()> _call) :
|
||||||
m_currentPoolId(_currentPoolId),
|
m_currentPoolId(_currentPoolId),
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include <ethread/PoolExecutor.hpp>
|
#include <ethread/PoolExecutor.hpp>
|
||||||
#include <ethread/tools.hpp>
|
#include <ethread/tools.hpp>
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::PoolExecutor);
|
||||||
|
|
||||||
ethread::PoolExecutor::PoolExecutor(ethread::Pool& _pool):
|
ethread::PoolExecutor::PoolExecutor(ethread::Pool& _pool):
|
||||||
m_needProcess(false),
|
m_needProcess(false),
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include <ethread/Future.hpp>
|
#include <ethread/Future.hpp>
|
||||||
#include <ethread/Promise.hpp>
|
#include <ethread/Promise.hpp>
|
||||||
#include <echrono/Steady.hpp>
|
#include <echrono/Steady.hpp>
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Promise);
|
||||||
|
|
||||||
ethread::Promise::Promise():
|
ethread::Promise::Promise():
|
||||||
m_isFinished(false) {
|
m_isFinished(false) {
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include <etk/types.hpp>
|
#include <etk/types.hpp>
|
||||||
#include <etk/os/Semaphore.hpp>
|
#include <etk/os/Semaphore.hpp>
|
||||||
#include <etk/debug.hpp>
|
#include <etk/debug.hpp>
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Semaphore);
|
||||||
|
|
||||||
etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) {
|
etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) {
|
||||||
// create interface mutex :
|
// create interface mutex :
|
||||||
|
@ -7,17 +7,19 @@
|
|||||||
#include <ethread/Semaphore.hpp>
|
#include <ethread/Semaphore.hpp>
|
||||||
//#include <ethread/debug.hpp>
|
//#include <ethread/debug.hpp>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Semaphore);
|
||||||
|
|
||||||
ethread::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) {
|
ethread::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) {
|
||||||
// create interface mutex :
|
// create interface mutex :
|
||||||
int ret = pthread_mutex_init(&m_mutex, nullptr);
|
int ret = pthread_mutex_init(&m_mutex, nullptr);
|
||||||
TK_ASSERT(ret == 0, "Error creating Mutex ...");
|
//TK_ASSERT(ret == 0, "Error creating Mutex ...");
|
||||||
// create contition :
|
// create contition :
|
||||||
ret = pthread_cond_init(&m_condition, nullptr);
|
ret = pthread_cond_init(&m_condition, nullptr);
|
||||||
TK_ASSERT(ret == 0, "Error creating Condition ...");
|
//TK_ASSERT(ret == 0, "Error creating Condition ...");
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
ret = pthread_mutex_destroy(&m_mutex);
|
ret = pthread_mutex_destroy(&m_mutex);
|
||||||
TK_ASSERT(ret == 0, "Error destroying Mutex ...");
|
//TK_ASSERT(ret == 0, "Error destroying Mutex ...");
|
||||||
}
|
}
|
||||||
m_maximum = _nbMessageMax;
|
m_maximum = _nbMessageMax;
|
||||||
m_data = _nbBasicElement;
|
m_data = _nbBasicElement;
|
||||||
@ -27,10 +29,10 @@ ethread::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax)
|
|||||||
ethread::Semaphore::~Semaphore() {
|
ethread::Semaphore::~Semaphore() {
|
||||||
// Remove condition
|
// Remove condition
|
||||||
int ret = pthread_cond_destroy(&m_condition);
|
int ret = pthread_cond_destroy(&m_condition);
|
||||||
TK_ASSERT(ret == 0, "Error destroying Condition ...");
|
//TK_ASSERT(ret == 0, "Error destroying Condition ...");
|
||||||
// Remove Mutex
|
// Remove Mutex
|
||||||
ret = pthread_mutex_destroy(&m_mutex);
|
ret = pthread_mutex_destroy(&m_mutex);
|
||||||
TK_ASSERT(ret == 0, "Error destroying Mutex ...");
|
//TK_ASSERT(ret == 0, "Error destroying Mutex ...");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ethread::Semaphore::getCount() {
|
uint32_t ethread::Semaphore::getCount() {
|
||||||
|
@ -38,8 +38,15 @@ namespace ethread {
|
|||||||
bool detach();
|
bool detach();
|
||||||
void threadCall();
|
void threadCall();
|
||||||
void setName(const etk::String& _name);
|
void setName(const etk::String& _name);
|
||||||
const etk::String& setName() const;
|
const etk::String& getName() const;
|
||||||
uint64_t getId() const;
|
uint64_t getId() const;
|
||||||
|
#ifdef __TARGET_OS__Windows
|
||||||
|
|
||||||
|
#else
|
||||||
|
pthread_t getNativeHandle() {
|
||||||
|
return m_thread;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,16 @@
|
|||||||
* @license MPL v2.0 (see license file)
|
* @license MPL v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
#include <ethread/Thread.hpp>
|
#include <ethread/Thread.hpp>
|
||||||
|
#include <ethread/tools.hpp>
|
||||||
|
|
||||||
|
#include <etk/typeInfo.hpp>
|
||||||
|
ETK_DECLARE_TYPE(ethread::Thread);
|
||||||
|
|
||||||
|
namespace ethread {
|
||||||
|
uint32_t getThreadHumanId(uint64_t _id);
|
||||||
|
etk::String getThreadName(uint64_t _id);
|
||||||
|
void setThreadName(ethread::Thread* _thread, const etk::String& _name);
|
||||||
|
}
|
||||||
|
|
||||||
void* ethread::Thread::threadCallback(void* _userData) {
|
void* ethread::Thread::threadCallback(void* _userData) {
|
||||||
ethread::Thread* threadHandle = static_cast<ethread::Thread*>(_userData);
|
ethread::Thread* threadHandle = static_cast<ethread::Thread*>(_userData);
|
||||||
@ -20,13 +29,10 @@ ethread::Thread::Thread(etk::Function<void()>&& _call, const etk::String& _name)
|
|||||||
m_uid(-1),
|
m_uid(-1),
|
||||||
m_name(_name),
|
m_name(_name),
|
||||||
m_function(etk::move(_call)) {
|
m_function(etk::move(_call)) {
|
||||||
|
uint32_t iii = ethread::getId();
|
||||||
pthread_create(&m_thread, nullptr, ðread::Thread::threadCallback, this);
|
pthread_create(&m_thread, nullptr, ðread::Thread::threadCallback, this);
|
||||||
/*
|
m_uid = ethread::getThreadHumanId(uint64_t(m_thread));
|
||||||
pthread_id_np_t tid;
|
printf("New thread: %d from %d", m_uid, iii);
|
||||||
pthread_getunique_np(&m_thread, &tid);
|
|
||||||
m_uid = uint64_t(tid);
|
|
||||||
*/
|
|
||||||
m_uid = *(uint64_t*)(m_thread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ethread::Thread::~Thread() {
|
ethread::Thread::~Thread() {
|
||||||
@ -40,13 +46,15 @@ void ethread::Thread::join() {
|
|||||||
|
|
||||||
bool ethread::Thread::detach() {
|
bool ethread::Thread::detach() {
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ethread::Thread::setName(const etk::String& _name) {
|
void ethread::Thread::setName(const etk::String& _name) {
|
||||||
m_name = _name;
|
m_name = _name;
|
||||||
|
ethread::setThreadName(this, m_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const etk::String& ethread::Thread::setName() const {
|
const etk::String& ethread::Thread::getName() const {
|
||||||
return m_name;
|
return m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include <ethread/tools.hpp>
|
#include <ethread/tools.hpp>
|
||||||
#include <etk/Pair.hpp>
|
#include <etk/Pair.hpp>
|
||||||
//#include <ethread/Mutex.hpp>
|
#include <ethread/Mutex.hpp>
|
||||||
// TODO: set mutex back ...
|
// TODO: set mutex back ...
|
||||||
#include <etk/Map.hpp>
|
#include <etk/Map.hpp>
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -19,34 +19,33 @@ extern "C" {
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//static ethread::Mutex g_lock;
|
static ethread::Mutex g_lock;
|
||||||
static etk::Map<uint32_t, etk::String>& getThreadList() {
|
static etk::Map<uint64_t, etk::String>& getThreadList() {
|
||||||
static etk::Map<uint32_t, etk::String> g_val;
|
static etk::Map<uint64_t, etk::String> g_val;
|
||||||
return g_val;
|
return g_val;
|
||||||
}
|
}
|
||||||
/*
|
namespace ethread {
|
||||||
static uint32_t getThreadHumanId(ethread::Thread::id _id) {
|
// Note: Declared in Thread.cpp
|
||||||
return 0;
|
uint32_t getThreadHumanId(uint64_t _id) {
|
||||||
uint32_t out = 0;
|
uint32_t out = 0;
|
||||||
uint64_t iddd = std::hash<ethread::Thread::id>()(_id);
|
g_lock.lock();
|
||||||
// TODO: g_lock.lock();
|
|
||||||
static etk::Map<uint64_t, uint32_t> g_list;
|
static etk::Map<uint64_t, uint32_t> g_list;
|
||||||
etk::Map<uint64_t, uint32_t>::Iterator it = g_list.find(iddd);
|
auto it = g_list.find(_id);
|
||||||
if (it == g_list.end()) {
|
if (it == g_list.end()) {
|
||||||
// attribute new ID :
|
// attribute new ID :
|
||||||
static uint32_t tmpId = 0;
|
static uint32_t tmpId = 0;
|
||||||
g_list.set(iddd,tmpId);
|
g_list.set(_id, tmpId);
|
||||||
out = tmpId;
|
out = tmpId;
|
||||||
tmpId++;
|
tmpId++;
|
||||||
} else {
|
} else {
|
||||||
out = it.getValue();
|
out = it.getValue();
|
||||||
}
|
}
|
||||||
// TODO: g_lock.unlock();
|
g_lock.unLock();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static etk::String getThreadName(ethread::Thread::id _id) {
|
etk::String getThreadName(uint64_t _id) {
|
||||||
etk::Map<uint32_t,etk::String>& list = getThreadList();
|
etk::Map<uint64_t,etk::String>& list = getThreadList();
|
||||||
uint32_t threadID = getThreadHumanId(_id);
|
uint32_t threadID = getThreadHumanId(_id);
|
||||||
etk::String out;
|
etk::String out;
|
||||||
// TODO: g_lock.lock();
|
// TODO: g_lock.lock();
|
||||||
@ -56,23 +55,24 @@ static etk::String getThreadName(ethread::Thread::id _id) {
|
|||||||
}
|
}
|
||||||
// TODO: g_lock.unlock();
|
// TODO: g_lock.unlock();
|
||||||
return out;
|
return out;
|
||||||
return "TODO";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void setThreadName(ethread::Thread* _thread, const etk::String& _name) {
|
void setThreadName(ethread::Thread* _thread, const etk::String& _name) {
|
||||||
etk::Map<uint32_t,etk::String>& list = getThreadList();
|
etk::Map<uint64_t,etk::String>& list = getThreadList();
|
||||||
uint32_t threadID = ethread::getId();
|
uint32_t threadID = ethread::getId();
|
||||||
// TODO: g_lock.lock();
|
// TODO: g_lock.lock();
|
||||||
list.set(threadID, _name);
|
list.set(threadID, _name);
|
||||||
vg_lock.unlock();
|
// TODO: 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__Android) \
|
||||||
|
) \
|
||||||
&& !defined(__TARGET_OS__Web)
|
&& !defined(__TARGET_OS__Web)
|
||||||
pthread_t pthreadID;
|
pthread_t pthreadID;
|
||||||
if (_thread == nullptr) {
|
if (_thread == nullptr) {
|
||||||
pthreadID = pthread_self();
|
pthreadID = pthread_self();
|
||||||
} else {
|
} else {
|
||||||
pthreadID = (pthread_t) _thread->native_handle();
|
pthreadID = _thread->getNativeHandle();
|
||||||
}
|
}
|
||||||
etk::String name = _name;
|
etk::String name = _name;
|
||||||
if (name.size() > 15) {
|
if (name.size() > 15) {
|
||||||
@ -84,39 +84,36 @@ static void setThreadName(ethread::Thread* _thread, const etk::String& _name) {
|
|||||||
#else
|
#else
|
||||||
//TODO: TK_INFO("Can not set the thread name in this OS (local set)");
|
//TODO: TK_INFO("Can not set the thread name in this OS (local set)");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
uint32_t ethread::getId() {
|
uint32_t ethread::getId() {
|
||||||
pthread_t self;
|
pthread_t self;
|
||||||
self = pthread_self();
|
self = pthread_self();
|
||||||
/*
|
return ethread::getThreadHumanId(uint64_t(self));
|
||||||
pthread_id_np_t tid;
|
|
||||||
pthread_getunique_np(&self, &tid);
|
|
||||||
return uint64_t(tid);
|
|
||||||
*/
|
|
||||||
return *(uint64_t*)(self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ethread::getId(ethread::Thread& _thread) {
|
uint32_t ethread::getId(ethread::Thread& _thread) {
|
||||||
return _thread.getId();
|
return ethread::getThreadHumanId(_thread.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ethread::setName(const etk::String& _name) {
|
void ethread::setName(const etk::String& _name) {
|
||||||
//setThreadName(nullptr, _name);
|
setThreadName(nullptr, _name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ethread::setName(ethread::Thread& _thread, const etk::String& _name) {
|
void ethread::setName(ethread::Thread& _thread, const etk::String& _name) {
|
||||||
//setThreadName(&_thread, _name);
|
_thread.setName(_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
etk::String ethread::getName() {
|
etk::String ethread::getName() {
|
||||||
//return getThreadName(std::this_thread::get_id());
|
pthread_t self;
|
||||||
return "";
|
self = pthread_self();
|
||||||
|
return getThreadName(uint64_t(self));
|
||||||
}
|
}
|
||||||
|
|
||||||
etk::String ethread::getName(ethread::Thread& _thread) {
|
etk::String ethread::getName(ethread::Thread& _thread) {
|
||||||
//return getThreadName(_thread.get_id());
|
return _thread.getName();
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__TARGET_OS__Linux) \
|
#if defined(__TARGET_OS__Linux) \
|
||||||
|
@ -44,12 +44,14 @@ def configure(target, my_module):
|
|||||||
'ethread/Mutex.Windows.cpp',
|
'ethread/Mutex.Windows.cpp',
|
||||||
'ethread/MutexRecursive.Windows.cpp',
|
'ethread/MutexRecursive.Windows.cpp',
|
||||||
'ethread/Thread.Windows.cpp',
|
'ethread/Thread.Windows.cpp',
|
||||||
|
'ethread/Semaphore.Windows.cpp',
|
||||||
])
|
])
|
||||||
else:
|
else:
|
||||||
my_module.add_src_file([
|
my_module.add_src_file([
|
||||||
'ethread/Mutex.pthread.cpp',
|
'ethread/Mutex.pthread.cpp',
|
||||||
'ethread/MutexRecursive.pthread.cpp',
|
'ethread/MutexRecursive.pthread.cpp',
|
||||||
'ethread/Thread.pthread.cpp',
|
'ethread/Thread.pthread.cpp',
|
||||||
|
'ethread/Semaphore.pthread.cpp',
|
||||||
])
|
])
|
||||||
my_module.add_depend([
|
my_module.add_depend([
|
||||||
'pthread',
|
'pthread',
|
||||||
|
@ -44,17 +44,6 @@ def configure(target, my_module):
|
|||||||
'ethread/PoolExecutor.hpp',
|
'ethread/PoolExecutor.hpp',
|
||||||
])
|
])
|
||||||
|
|
||||||
if "Windows" in target.get_type():
|
|
||||||
my_module.add_src_file([
|
|
||||||
'ethread/Semaphore.Windows.cpp',
|
|
||||||
])
|
|
||||||
else:
|
|
||||||
my_module.add_src_file([
|
|
||||||
'ethread/Semaphore.pthread.cpp',
|
|
||||||
])
|
|
||||||
my_module.add_depend([
|
|
||||||
'pthread',
|
|
||||||
])
|
|
||||||
# build in C++ mode
|
# build in C++ mode
|
||||||
my_module.compile_version("c++", 2011)
|
my_module.compile_version("c++", 2011)
|
||||||
# add dependency of the generic C++ library:
|
# add dependency of the generic C++ library:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user