| 556 | } |
| 557 | |
| 558 | int bthread_usleep(uint64_t microseconds) { |
| 559 | bthread::TaskGroup* g = bthread::BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group); |
| 560 | if (NULL != g && !g->is_current_pthread_task()) { |
| 561 | return bthread::TaskGroup::usleep(&g, microseconds); |
| 562 | } |
| 563 | return ::usleep(microseconds); |
| 564 | } |
| 565 | |
| 566 | int bthread_yield(void) { |
| 567 | bthread::TaskGroup* g = bthread::BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group); |