| 210 | } |
| 211 | |
| 212 | inline void Start() { |
| 213 | pthread_attr_t* pattrs = nullptr; |
| 214 | pthread_attr_t attrs; |
| 215 | |
| 216 | if (P_->StackSize > 0) { |
| 217 | Zero(attrs); |
| 218 | pthread_attr_init(&attrs); |
| 219 | pattrs = &attrs; |
| 220 | |
| 221 | if (P_->StackPointer) { |
| 222 | pthread_attr_setstack(pattrs, P_->StackPointer, P_->StackSize); |
| 223 | } else { |
| 224 | pthread_attr_setstacksize(pattrs, StackSize(*P_)); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | { |
| 229 | TParams* holdP = P_.Release(); |
| 230 | int err = pthread_create(&H_, pattrs, ThreadProxy, holdP); |
| 231 | if (err) { |
| 232 | H_ = {}; |
| 233 | P_.Reset(holdP); |
| 234 | PCHECK(err, "failed to create thread"); |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | private: |
| 240 | static void* ThreadProxy(void* arg) { |
nothing calls this directly
no test coverage detected