150 |
RunningCondition.Set(false); |
RunningCondition.Set(false); |
151 |
return res; |
return res; |
152 |
} |
} |
153 |
|
|
154 |
// Create and run the thread |
// Create and run the thread |
155 |
res = pthread_create(&this->__thread_id, &__thread_attr, __pthread_launcher, this); |
res = pthread_create(&this->__thread_id, &__thread_attr, __pthread_launcher, this); |
156 |
switch (res) { |
switch (res) { |
219 |
#else |
#else |
220 |
RunningCondition.Set(false); |
RunningCondition.Set(false); |
221 |
#endif |
#endif |
222 |
#else |
#else |
223 |
pthread_cancel(__thread_id); |
pthread_cancel(__thread_id); |
224 |
#endif |
#endif |
225 |
return 0; |
return 0; |
376 |
#else |
#else |
377 |
/// Callback function for the POSIX thread API |
/// Callback function for the POSIX thread API |
378 |
static void* __pthread_launcher(void* thread) { |
static void* __pthread_launcher(void* thread) { |
379 |
|
#if !CONFIG_PTHREAD_TESTCANCEL |
380 |
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); // let the thread be killable under any circumstances |
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); // let the thread be killable under any circumstances |
381 |
|
#endif |
382 |
|
|
383 |
Thread* t; |
Thread* t; |
384 |
t = (Thread*) thread; |
t = (Thread*) thread; |
385 |
t->SetSchedulingPriority(); |
t->SetSchedulingPriority(); |