| 117 | } |
| 118 | } |
| 119 | bool start_nothrow() { |
| 120 | if (need_join) { |
| 121 | return need_join; /* true */ |
| 122 | } |
| 123 | void *const arg = this; |
| 124 | pthread_attr_t attr; |
| 125 | if (pthread_attr_init(&attr) != 0) { |
| 126 | fatal_abort("pthread_attr_init"); |
| 127 | } |
| 128 | if (pthread_attr_setstacksize(&attr, stack_size) != 0) { |
| 129 | fatal_abort("pthread_attr_setstacksize"); |
| 130 | } |
| 131 | const int r = pthread_create(&thr, &attr, thread_main, arg); |
| 132 | if (pthread_attr_destroy(&attr) != 0) { |
| 133 | fatal_abort("pthread_attr_destroy"); |
| 134 | } |
| 135 | if (r != 0) { |
| 136 | return need_join; /* false */ |
| 137 | } |
| 138 | need_join = true; |
| 139 | return need_join; /* true */ |
| 140 | } |
| 141 | void join() { |
| 142 | if (!need_join) { |
| 143 | return; |
nothing calls this directly
no test coverage detected