Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PipeWire
wireplumber
Commits
e04f9359
Commit
e04f9359
authored
Dec 06, 2019
by
Julian Bouzas
Browse files
core: return a boolean in sync API
parent
9b255922
Pipeline
#86278
failed with stage
in 5 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/wp/core.c
View file @
e04f9359
...
...
@@ -478,14 +478,14 @@ wp_core_idle_add (WpCore * self, GSourceFunc function, gpointer data)
return
source
;
}
void
gboolean
wp_core_sync
(
WpCore
*
self
,
GCancellable
*
cancellable
,
GAsyncReadyCallback
callback
,
gpointer
user_data
)
{
g_autoptr
(
GTask
)
task
=
NULL
;
int
seq
;
g_return_if_fail
(
WP_IS_CORE
(
self
));
g_return_
val_
if_fail
(
WP_IS_CORE
(
self
)
,
FALSE
);
task
=
g_task_new
(
self
,
cancellable
,
callback
,
user_data
);
...
...
@@ -493,7 +493,7 @@ wp_core_sync (WpCore * self, GCancellable * cancellable,
g_warn_if_reached
();
g_task_return_new_error
(
task
,
WP_DOMAIN_LIBRARY
,
WP_LIBRARY_ERROR_INVARIANT
,
"No core proxy"
);
return
;
return
FALSE
;
}
seq
=
pw_core_proxy_sync
(
self
->
core_proxy
,
0
,
0
);
...
...
@@ -501,11 +501,12 @@ wp_core_sync (WpCore * self, GCancellable * cancellable,
g_task_return_new_error
(
task
,
WP_DOMAIN_LIBRARY
,
WP_LIBRARY_ERROR_OPERATION_FAILED
,
"pw_core_proxy_sync failed: %s"
,
g_strerror
(
-
seq
));
return
;
return
FALSE
;
}
g_hash_table_insert
(
self
->
async_tasks
,
GINT_TO_POINTER
(
seq
),
g_steal_pointer
(
&
task
));
return
TRUE
;
}
struct
pw_core
*
...
...
lib/wp/core.h
View file @
e04f9359
...
...
@@ -41,7 +41,7 @@ WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
GMainContext
*
wp_core_get_context
(
WpCore
*
self
);
GSource
*
wp_core_idle_add
(
WpCore
*
self
,
GSourceFunc
function
,
gpointer
data
);
void
wp_core_sync
(
WpCore
*
self
,
GCancellable
*
cancellable
,
gboolean
wp_core_sync
(
WpCore
*
self
,
GCancellable
*
cancellable
,
GAsyncReadyCallback
callback
,
gpointer
user_data
);
struct
pw_core
*
wp_core_get_pw_core
(
WpCore
*
self
);
struct
pw_remote
*
wp_core_get_pw_remote
(
WpCore
*
self
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment