| 26 | |
| 27 | #define sucfail(r) (r != 0 ? "failed" : "succeeded") |
| 28 | int libc_ex1(void) |
| 29 | { |
| 30 | int pret, ret = 0; |
| 31 | pthread_t th_a, th_b; |
| 32 | void *retval; |
| 33 | |
| 34 | ret += (pret = pthread_create(&th_a, NULL, process, (void *)"a")); |
| 35 | printf("create a %s %d\n", sucfail(pret), pret); |
| 36 | ret += (pret = pthread_create(&th_b, NULL, process, (void *)"b")); |
| 37 | printf("create b %s %d\n", sucfail(pret), pret); |
| 38 | ret += (pret = pthread_join(th_a, &retval)); |
| 39 | printf("join a %s %d\n", sucfail(pret), pret); |
| 40 | ret += (pret = pthread_join(th_b, &retval)); |
| 41 | printf("join b %s %d\n", sucfail(pret), pret); |
| 42 | return ret; |
| 43 | } |
| 44 | #include <finsh.h> |
| 45 | FINSH_FUNCTION_EXPORT(libc_ex1, example 1 for libc); |
nothing calls this directly
no test coverage detected