utils: implement g_cancellable_new_with_timeout

This commit is contained in:
Dirk-Jan C. Binnema
2023-04-29 00:52:37 +03:00
parent 2c69a6d84b
commit e4af910d04
2 changed files with 61 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include <cinttypes>
#include <sys/stat.h>
#include <gio/gio.h>
#include <utils/mu-option.hh>
#include <utils/mu-regex.hh>
@ -157,6 +158,17 @@ std::string join_paths(S&& s, Args...args) {
}
/**
* Like g_cancellable_new(), but automatically cancels itself
* after timeout
*
* @param timeout timeout in millisecs
*
* @return A GCancellable* instances; free with g_object_unref() when
* no longer needed.
*/
GCancellable* g_cancellable_new_with_timeout(guint timeout);
} // namespace Mu
#endif /* MU_UTILS_FILE_HH__ */