Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
e04f9359
Commit
e04f9359
authored
5 years ago
by
Julian Bouzas
Browse files
Options
Downloads
Patches
Plain Diff
core: return a boolean in sync API
parent
9b255922
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/wp/core.c
+5
-4
5 additions, 4 deletions
lib/wp/core.c
lib/wp/core.h
+1
-1
1 addition, 1 deletion
lib/wp/core.h
with
6 additions
and
5 deletions
lib/wp/core.c
+
5
−
4
View file @
e04f9359
...
@@ -478,14 +478,14 @@ wp_core_idle_add (WpCore * self, GSourceFunc function, gpointer data)
...
@@ -478,14 +478,14 @@ wp_core_idle_add (WpCore * self, GSourceFunc function, gpointer data)
return
source
;
return
source
;
}
}
void
gboolean
wp_core_sync
(
WpCore
*
self
,
GCancellable
*
cancellable
,
wp_core_sync
(
WpCore
*
self
,
GCancellable
*
cancellable
,
GAsyncReadyCallback
callback
,
gpointer
user_data
)
GAsyncReadyCallback
callback
,
gpointer
user_data
)
{
{
g_autoptr
(
GTask
)
task
=
NULL
;
g_autoptr
(
GTask
)
task
=
NULL
;
int
seq
;
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
);
task
=
g_task_new
(
self
,
cancellable
,
callback
,
user_data
);
...
@@ -493,7 +493,7 @@ wp_core_sync (WpCore * self, GCancellable * cancellable,
...
@@ -493,7 +493,7 @@ wp_core_sync (WpCore * self, GCancellable * cancellable,
g_warn_if_reached
();
g_warn_if_reached
();
g_task_return_new_error
(
task
,
WP_DOMAIN_LIBRARY
,
g_task_return_new_error
(
task
,
WP_DOMAIN_LIBRARY
,
WP_LIBRARY_ERROR_INVARIANT
,
"No core proxy"
);
WP_LIBRARY_ERROR_INVARIANT
,
"No core proxy"
);
return
;
return
FALSE
;
}
}
seq
=
pw_core_proxy_sync
(
self
->
core_proxy
,
0
,
0
);
seq
=
pw_core_proxy_sync
(
self
->
core_proxy
,
0
,
0
);
...
@@ -501,11 +501,12 @@ wp_core_sync (WpCore * self, GCancellable * cancellable,
...
@@ -501,11 +501,12 @@ wp_core_sync (WpCore * self, GCancellable * cancellable,
g_task_return_new_error
(
task
,
WP_DOMAIN_LIBRARY
,
g_task_return_new_error
(
task
,
WP_DOMAIN_LIBRARY
,
WP_LIBRARY_ERROR_OPERATION_FAILED
,
"pw_core_proxy_sync failed: %s"
,
WP_LIBRARY_ERROR_OPERATION_FAILED
,
"pw_core_proxy_sync failed: %s"
,
g_strerror
(
-
seq
));
g_strerror
(
-
seq
));
return
;
return
FALSE
;
}
}
g_hash_table_insert
(
self
->
async_tasks
,
GINT_TO_POINTER
(
seq
),
g_hash_table_insert
(
self
->
async_tasks
,
GINT_TO_POINTER
(
seq
),
g_steal_pointer
(
&
task
));
g_steal_pointer
(
&
task
));
return
TRUE
;
}
}
struct
pw_core
*
struct
pw_core
*
...
...
This diff is collapsed.
Click to expand it.
lib/wp/core.h
+
1
−
1
View file @
e04f9359
...
@@ -41,7 +41,7 @@ WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
...
@@ -41,7 +41,7 @@ WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
GMainContext
*
wp_core_get_context
(
WpCore
*
self
);
GMainContext
*
wp_core_get_context
(
WpCore
*
self
);
GSource
*
wp_core_idle_add
(
WpCore
*
self
,
GSourceFunc
function
,
gpointer
data
);
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
);
GAsyncReadyCallback
callback
,
gpointer
user_data
);
struct
pw_core
*
wp_core_get_pw_core
(
WpCore
*
self
);
struct
pw_core
*
wp_core_get_pw_core
(
WpCore
*
self
);
struct
pw_remote
*
wp_core_get_pw_remote
(
WpCore
*
self
);
struct
pw_remote
*
wp_core_get_pw_remote
(
WpCore
*
self
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment