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

Method Clear

library/cpp/yt/threading/notification_handle.cpp:78–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void TNotificationHandle::Clear()
79{
80#ifdef _linux_
81 uint64_t count = 0;
82 auto ret = HandleEintr(read, EventFD_, &count, sizeof(count));
83 // For edge-triggered one could clear multiple events, others get nothing.
84 YT_VERIFY(ret == sizeof(count) || (ret < 0 && errno == EAGAIN));
85#elif defined(_win_)
86 while (true) {
87 char c;
88 auto ret = Reader_.Read(&c, sizeof(c));
89 YT_VERIFY(ret == sizeof(c) || (ret == SOCKET_ERROR && WSAGetLastError() == WSAEWOULDBLOCK));
90 if (ret == SOCKET_ERROR) {
91 break;
92 }
93 }
94#else
95 while (true) {
96 char c;
97 auto ret = HandleEintr(read, PipeFDs_[0], &c, sizeof(c));
98 YT_VERIFY(ret == sizeof(c) || (ret < 0 && errno == EAGAIN));
99 if (ret < 0) {
100 break;
101 }
102 }
103#endif
104}
105
106int TNotificationHandle::GetFD() const
107{

Callers

nothing calls this directly

Calls 2

HandleEintrFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected