| OLD | NEW |
| 1 #include "pthread_impl.h" | 1 #include "pthread_impl.h" |
| 2 #include <threads.h> | 2 #include <threads.h> |
| 3 | 3 |
| 4 int __pthread_create(pthread_t *restrict, const pthread_attr_t *restrict, void *
(*)(void *), void *restrict); | 4 int __pthread_create(pthread_t* restrict, |
| 5 const pthread_attr_t* restrict, |
| 6 void* (*)(void*), |
| 7 void* restrict); |
| 5 | 8 |
| 6 int thrd_create(thrd_t *thr, thrd_start_t func, void *arg) | 9 int thrd_create(thrd_t* thr, thrd_start_t func, void* arg) { |
| 7 { | 10 int ret = |
| 8 » int ret = __pthread_create(thr, __ATTRP_C11_THREAD, (void *(*)(void *))f
unc, arg); | 11 __pthread_create(thr, __ATTRP_C11_THREAD, (void* (*)(void*))func, arg); |
| 9 » switch (ret) { | 12 switch (ret) { |
| 10 » case 0: return thrd_success; | 13 case 0: |
| 11 » case EAGAIN: return thrd_nomem; | 14 return thrd_success; |
| 12 » default: return thrd_error; | 15 case EAGAIN: |
| 13 » } | 16 return thrd_nomem; |
| 17 default: |
| 18 return thrd_error; |
| 19 } |
| 14 } | 20 } |
| OLD | NEW |