| 19 | } |
| 20 | |
| 21 | int libc_ex6(void) { |
| 22 | unsigned long count; |
| 23 | |
| 24 | setvbuf(stdout, NULL, _IONBF, 0); |
| 25 | |
| 26 | for (count = 0; count < 2000; ++count) { |
| 27 | pthread_t thread; |
| 28 | int status; |
| 29 | |
| 30 | status = pthread_create(&thread, NULL, test_thread, NULL); |
| 31 | if (status != 0) { |
| 32 | printf("status = %d, count = %lu: %s\n", status, count, strerror( |
| 33 | errno)); |
| 34 | return 1; |
| 35 | } else { |
| 36 | printf("count = %lu\n", count); |
| 37 | } |
| 38 | /* pthread_detach (thread); */ |
| 39 | pthread_join(thread, NULL); |
| 40 | usleep(10); |
| 41 | } |
| 42 | return 0; |
| 43 | } |
| 44 | #include <finsh.h> |
| 45 | FINSH_FUNCTION_EXPORT(libc_ex6, example 6 for libc); |
nothing calls this directly
no test coverage detected