| 541 | } |
| 542 | |
| 543 | int bthread_timer_del(bthread_timer_t id) { |
| 544 | bthread::TaskControl* c = bthread::get_task_control(); |
| 545 | if (c != NULL) { |
| 546 | bthread::TimerThread* tt = bthread::get_global_timer_thread(); |
| 547 | if (tt == NULL) { |
| 548 | return EINVAL; |
| 549 | } |
| 550 | const int state = tt->unschedule(id); |
| 551 | if (state >= 0) { |
| 552 | return state; |
| 553 | } |
| 554 | } |
| 555 | return EINVAL; |
| 556 | } |
| 557 | |
| 558 | int bthread_usleep(uint64_t microseconds) { |
| 559 | bthread::TaskGroup* g = bthread::BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group); |
no test coverage detected