From aeb2baa495776d9fc06e63f91167c40c334303c8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 29 Dec 2013 18:08:49 +0100 Subject: InputStream: add static method OpenReady() Merge some duplicate code. --- src/InputStream.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/InputStream.hxx') diff --git a/src/InputStream.hxx b/src/InputStream.hxx index b1bc9c4ab..5ac3bdcae 100644 --- a/src/InputStream.hxx +++ b/src/InputStream.hxx @@ -118,6 +118,15 @@ struct InputStream { static InputStream *Open(const char *uri, Mutex &mutex, Cond &cond, Error &error); + /** + * Just like Open(), but waits for the stream to become ready. + * It is a wrapper for Open(), WaitReady() and Check(). + */ + gcc_malloc gcc_nonnull_all + static InputStream *OpenReady(const char *uri, + Mutex &mutex, Cond &cond, + Error &error); + /** * Close the input stream and free resources. * -- cgit v1.2.3