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

Function wait_for_the_fd

test/bthread_fd_unittest.cpp:487–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487void* wait_for_the_fd(void* arg) {
488 timespec ts = butil::milliseconds_from_now(50);
489#if defined(OS_LINUX)
490 bthread_fd_timedwait(*(int*)arg, EPOLLIN, &ts);
491#elif defined(OS_MACOSX)
492 bthread_fd_timedwait(*(int*)arg, EVFILT_READ, &ts);
493#endif
494 return NULL;
495}
496
497TEST(FDTest, timeout) {
498 int fds[2];

Callers

nothing calls this directly

Calls 2

milliseconds_from_nowFunction · 0.85
bthread_fd_timedwaitFunction · 0.85

Tested by

no test coverage detected