diff --git a/headers/private/app/LinkReceiver.h b/headers/private/app/LinkReceiver.h index 19ab637ca1..fc2f275945 100644 --- a/headers/private/app/LinkReceiver.h +++ b/headers/private/app/LinkReceiver.h @@ -27,6 +27,7 @@ class LinkReceiver { port_id Port(void) { return fReceivePort; } status_t GetNextMessage(int32 &code, bigtime_t timeout = B_INFINITE_TIMEOUT); + bool HasMessages() const; bool NeedsReply() const; int32 Code() const; diff --git a/src/kits/app/LinkReceiver.cpp b/src/kits/app/LinkReceiver.cpp index dfd4d65b0f..1dfab3152c 100644 --- a/src/kits/app/LinkReceiver.cpp +++ b/src/kits/app/LinkReceiver.cpp @@ -101,6 +101,13 @@ LinkReceiver::GetNextMessage(int32 &code, bigtime_t timeout) } +bool +LinkReceiver::HasMessages() const +{ + return port_count(fReceivePort) > 0; +} + + bool LinkReceiver::NeedsReply() const {