MCPcopy Create free account
hub / github.com/catboost/catboost / Start

Method Start

util/system/thread.cpp:212–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 5

ZeroFunction · 0.85
StackSizeFunction · 0.85
pthread_createFunction · 0.85
ReleaseMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected