mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-31 13:24:13 +02:00
streams: add private 'async close via threads' API
Add an internal helper to find out if close_async() is implemented via threads using the default implementation in the base class. We will use this to decide if we should do a 'pure async' close of a GIOStream or not. https://bugzilla.gnome.org/show_bug.cgi?id=741630
This commit is contained in:
@@ -1253,6 +1253,26 @@ g_input_stream_async_read_is_via_threads (GInputStream *stream)
|
||||
g_pollable_input_stream_can_poll (G_POLLABLE_INPUT_STREAM (stream))));
|
||||
}
|
||||
|
||||
/*< internal >
|
||||
* g_input_stream_async_close_is_via_threads:
|
||||
* @stream: input stream
|
||||
*
|
||||
* Checks if an input stream's close_async function uses threads.
|
||||
*
|
||||
* Returns: %TRUE if @stream's close_async function uses threads.
|
||||
**/
|
||||
gboolean
|
||||
g_input_stream_async_close_is_via_threads (GInputStream *stream)
|
||||
{
|
||||
GInputStreamClass *class;
|
||||
|
||||
g_return_val_if_fail (G_IS_INPUT_STREAM (stream), FALSE);
|
||||
|
||||
class = G_INPUT_STREAM_GET_CLASS (stream);
|
||||
|
||||
return class->close_async == g_input_stream_real_close_async;
|
||||
}
|
||||
|
||||
/********************************************
|
||||
* Default implementation of async ops *
|
||||
********************************************/
|
||||
|
Reference in New Issue
Block a user