| 168 | } |
| 169 | |
| 170 | int Thread::join(void **prval) |
| 171 | { |
| 172 | if (thread_id == 0) { |
| 173 | ceph_abort_msg("join on thread that was never started"); |
| 174 | return -EINVAL; |
| 175 | } |
| 176 | |
| 177 | int status = pthread_join(thread_id, prval); |
| 178 | if (status != 0) { |
| 179 | char buf[256]; |
| 180 | snprintf(buf, sizeof(buf), "Thread::join(): pthread_join " |
| 181 | "failed with error %d\n", status); |
| 182 | dout_emergency(buf); |
| 183 | ceph_assert(status == 0); |
| 184 | } |
| 185 | |
| 186 | thread_id = 0; |
| 187 | return status; |
| 188 | } |
| 189 | |
| 190 | int Thread::detach() |
| 191 | { |