MCPcopy Create free account
hub / github.com/apache/brpc / bthread_yield

Function bthread_yield

src/bthread/bthread.cpp:566–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566int bthread_yield(void) {
567 bthread::TaskGroup* g = bthread::BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group);
568 if (NULL != g && !g->is_current_pthread_task()) {
569 bthread::TaskGroup::yield(&g);
570 return 0;
571 }
572 // pthread_yield is not available on MAC
573 return sched_yield();
574}
575
576int bthread_set_worker_startfn(void (*start_fn)()) {
577 if (start_fn == NULL) {

Callers 2

yield_threadFunction · 0.85
PollingModeInitializeMethod · 0.85

Calls 1

Tested by 1

yield_threadFunction · 0.68