MCPcopy Create free account
hub / github.com/catboost/catboost / TNotificationHandle

Method TNotificationHandle

library/cpp/yt/threading/notification_handle.cpp:27–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25////////////////////////////////////////////////////////////////////////////////
26
27TNotificationHandle::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
54TNotificationHandle::~TNotificationHandle()
55{

Callers

nothing calls this directly

Calls 3

HandleEintrFunction · 0.85
TSimpleExceptionClass · 0.85
SetNonBlockFunction · 0.85

Tested by

no test coverage detected