| 407 | } |
| 408 | |
| 409 | void* epoll_waiter(void* arg) { |
| 410 | #if defined(OS_LINUX) |
| 411 | epoll_event e; |
| 412 | if (1 == epoll_wait((int)(intptr_t)arg, &e, 1, -1)) { |
| 413 | std::cout << e.events << std::endl; |
| 414 | } |
| 415 | #elif defined(OS_MACOSX) |
| 416 | struct kevent e; |
| 417 | if (1 == kevent((int)(intptr_t)arg, NULL, 0, &e, 1, NULL)) { |
| 418 | std::cout << e.flags << std::endl; |
| 419 | } |
| 420 | #endif |
| 421 | std::cout << pthread_self() << " quits" << std::endl; |
| 422 | return NULL; |
| 423 | } |
| 424 | |
| 425 | TEST(FDTest, interrupt_pthread) { |
| 426 | #if defined(OS_LINUX) |