| 32 | } |
| 33 | } |
| 34 | bool start_nothrow() { |
| 35 | if (need_join) { |
| 36 | return need_join; /* true */ |
| 37 | } |
| 38 | void *const arg = this; |
| 39 | pthread_attr_t attr; |
| 40 | if (pthread_attr_init(&attr) != 0) { |
| 41 | fatal_abort("pthread_attr_init"); |
| 42 | } |
| 43 | if (pthread_attr_setstacksize(&attr, stack_size) != 0) { |
| 44 | fatal_abort("pthread_attr_setstacksize"); |
| 45 | } |
| 46 | const int r = pthread_create(&thr, &attr, thread_main, arg); |
| 47 | if (pthread_attr_destroy(&attr) != 0) { |
| 48 | fatal_abort("pthread_attr_destroy"); |
| 49 | } |
| 50 | if (r != 0) { |
| 51 | return need_join; /* false */ |
| 52 | } |
| 53 | need_join = true; |
| 54 | return need_join; /* true */ |
| 55 | } |
| 56 | void join() { |
| 57 | if (!need_join) { |
| 58 | return; |
nothing calls this directly
no test coverage detected