The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

u/worker: Init mutex and cond var

+20
+20
src/xrt/auxiliary/util/u_worker.c
··· 390 390 u_worker_thread_pool_create(uint32_t starting_worker_count, uint32_t thread_count) 391 391 { 392 392 XRT_TRACE_MARKER(); 393 + int ret; 393 394 394 395 assert(starting_worker_count < thread_count); 395 396 if (starting_worker_count >= thread_count) { ··· 408 409 p->thread_count = thread_count; 409 410 p->running = true; 410 411 412 + ret = os_mutex_init(&p->mutex); 413 + if (ret != 0) { 414 + goto err_alloc; 415 + } 416 + 417 + ret = os_cond_init(&p->available.cond); 418 + if (ret != 0) { 419 + goto err_mutex; 420 + } 421 + 411 422 for (size_t i = 0; i < thread_count; i++) { 412 423 p->threads[i].p = p; 413 424 os_thread_init(&p->threads[i].thread); ··· 415 426 } 416 427 417 428 return (struct u_worker_thread_pool *)p; 429 + 430 + 431 + err_mutex: 432 + os_mutex_destroy(&p->mutex); 433 + 434 + err_alloc: 435 + free(p); 436 + 437 + return NULL; 418 438 } 419 439 420 440 void