| 25 | //////////////////////////////////////////////////////////////////////////////// |
| 26 | |
| 27 | TNotificationHandle::TNotificationHandle(bool blocking) |
| 28 | { |
| 29 | #ifdef _linux_ |
| 30 | EventFD_ = HandleEintr( |
| 31 | eventfd, |
| 32 | 0, |
| 33 | EFD_CLOEXEC | (blocking ? 0 : EFD_NONBLOCK)); |
| 34 | if (EventFD_ < 0) { |
| 35 | throw TSimpleException("Error creating notification handle"); |
| 36 | } |
| 37 | #elif defined(_win_) |
| 38 | TPipeHandle::Pipe(Reader_, Writer_, EOpenModeFlag::CloseOnExec); |
| 39 | if (!blocking) { |
| 40 | SetNonBlock(Reader_); |
| 41 | } |
| 42 | #else |
| 43 | #ifdef _darwin_ |
| 44 | YT_VERIFY(HandleEintr(pipe, PipeFDs_) == 0); |
| 45 | #else |
| 46 | YT_VERIFY(HandleEintr(pipe2, PipeFDs_, O_CLOEXEC) == 0); |
| 47 | #endif |
| 48 | if (!blocking) { |
| 49 | YT_VERIFY(fcntl(PipeFDs_[0], F_SETFL, O_NONBLOCK) == 0); |
| 50 | } |
| 51 | #endif |
| 52 | } |
| 53 | |
| 54 | TNotificationHandle::~TNotificationHandle() |
| 55 | { |
nothing calls this directly
no test coverage detected