system/Event{FD,Pipe}: add "noexcept"

This commit is contained in:
Max Kellermann 2018-08-06 11:57:40 +02:00
parent 0c1a001622
commit 5b09504a71
4 changed files with 12 additions and 12 deletions

View File

@ -33,7 +33,7 @@ EventFD::EventFD()
}
bool
EventFD::Read()
EventFD::Read() noexcept
{
assert(fd.IsDefined());
@ -42,7 +42,7 @@ EventFD::Read()
}
void
EventFD::Write()
EventFD::Write() noexcept
{
assert(fd.IsDefined());

View File

@ -35,7 +35,7 @@ public:
*/
EventFD();
int Get() const {
int Get() const noexcept {
return fd.Get();
}
@ -43,13 +43,13 @@ public:
* Checks if Write() was called at least once since the last
* Read() call.
*/
bool Read();
bool Read() noexcept;
/**
* Wakes up the reader. Multiple calls to this function will
* be combined to one wakeup.
*/
void Write();
void Write() noexcept;
};
#endif

View File

@ -52,7 +52,7 @@ EventPipe::EventPipe()
#endif
}
EventPipe::~EventPipe()
EventPipe::~EventPipe() noexcept
{
#ifdef _WIN32
closesocket(fds[0]);
@ -64,7 +64,7 @@ EventPipe::~EventPipe()
}
bool
EventPipe::Read()
EventPipe::Read() noexcept
{
assert(fds[0] >= 0);
assert(fds[1] >= 0);
@ -78,7 +78,7 @@ EventPipe::Read()
}
void
EventPipe::Write()
EventPipe::Write() noexcept
{
assert(fds[0] >= 0);
assert(fds[1] >= 0);

View File

@ -36,12 +36,12 @@ public:
*/
EventPipe();
~EventPipe();
~EventPipe() noexcept;
EventPipe(const EventPipe &other) = delete;
EventPipe &operator=(const EventPipe &other) = delete;
int Get() const {
int Get() const noexcept {
return fds[0];
}
@ -49,13 +49,13 @@ public:
* Checks if Write() was called at least once since the last
* Read() call.
*/
bool Read();
bool Read() noexcept;
/**
* Wakes up the reader. Multiple calls to this function will
* be combined to one wakeup.
*/
void Write();
void Write() noexcept;
};
#endif /* MAIN_NOTIFY_H */