| 51 | } |
| 52 | |
| 53 | const char *test_thread1(void) |
| 54 | { |
| 55 | unsigned int i; |
| 56 | size_t total = 0; |
| 57 | |
| 58 | atomic_store(&finish, true); |
| 59 | atomic_store(&threads_finished, 0); |
| 60 | |
| 61 | for (i = 0; i < THREADS; i++) { |
| 62 | thread_t *t; |
| 63 | if (!(t = thread_create(threadtest, NULL, TASK, |
| 64 | THREAD_FLAG_NONE, "threadtest"))) { |
| 65 | TPRINTF("Could not create thread %d\n", i); |
| 66 | break; |
| 67 | } |
| 68 | thread_ready(t); |
| 69 | total++; |
| 70 | } |
| 71 | |
| 72 | TPRINTF("Running threads for 10 seconds...\n"); |
| 73 | thread_sleep(10); |
| 74 | |
| 75 | atomic_store(&finish, false); |
| 76 | while (atomic_load(&threads_finished) < total) { |
| 77 | TPRINTF("Threads left: %zu\n", total - atomic_load(&threads_finished)); |
| 78 | thread_sleep(1); |
| 79 | } |
| 80 | |
| 81 | return NULL; |
| 82 | } |
nothing calls this directly
no test coverage detected