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

Function bthread_fd_timedwait

src/bthread/fd.cpp:457–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457int bthread_fd_timedwait(int fd, unsigned events,
458 const timespec* abstime) {
459 if (NULL == abstime) {
460 return bthread_fd_wait(fd, events);
461 }
462 if (fd < 0) {
463 errno = EINVAL;
464 return -1;
465 }
466 bthread::TaskGroup* g = bthread::tls_task_group;
467 if (NULL != g && !g->is_current_pthread_task()) {
468 return bthread::get_epoll_thread(fd).fd_wait(
469 fd, events, abstime);
470 }
471 return bthread::pthread_fd_wait(fd, events, abstime);
472}
473
474int bthread_connect(int sockfd, const sockaddr* serv_addr,
475 socklen_t addrlen) {

Callers 3

TESTFunction · 0.85
wait_for_the_fdFunction · 0.85
bthread_timed_connectFunction · 0.85

Calls 3

bthread_fd_waitFunction · 0.85
pthread_fd_waitFunction · 0.70

Tested by 2

TESTFunction · 0.68
wait_for_the_fdFunction · 0.68