[pulseaudio-commits] 2 commits - src/pulsecore
David Henningsson
diwic at kemper.freedesktop.org
Tue Apr 22 07:33:10 PDT 2014
src/pulsecore/fdsem.c | 3 +--
src/pulsecore/fdsem.h | 4 +++-
src/pulsecore/shmasyncq.c | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 48420b660af5e8df9490b5265efaa55b459b7745
Author: David Henningsson <david.henningsson at canonical.com>
Date: Tue Apr 15 17:23:06 2014 +0200
fdsem: Use atomic.h
The fdsem header uses pa_atomic_t, which is declared in atomic.h
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
diff --git a/src/pulsecore/fdsem.h b/src/pulsecore/fdsem.h
index 3f1d9a1..1b1a5a5 100644
--- a/src/pulsecore/fdsem.h
+++ b/src/pulsecore/fdsem.h
@@ -28,6 +28,8 @@
* the best case all functions are lock-free unless sleeping is
* required. */
+#include <pulsecore/atomic.h>
+
typedef struct pa_fdsem pa_fdsem;
typedef struct pa_fdsem_data {
commit 6c42cfe32497c3b8a83929971ba109ec486dbc11
Author: David Henningsson <david.henningsson at canonical.com>
Date: Tue Apr 15 16:26:12 2014 +0200
fdsem: remove superfluous parameter in call to pa_fdsem_new_shm
This parameter was never assigned, so just remove it.
Note that the only current user of this function is shmasyncq.c,
which is unused - we don't even build it. But I fixed it up anyway.
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
diff --git a/src/pulsecore/fdsem.c b/src/pulsecore/fdsem.c
index ec32461..b153ddd 100644
--- a/src/pulsecore/fdsem.c
+++ b/src/pulsecore/fdsem.c
@@ -100,11 +100,10 @@ pa_fdsem *pa_fdsem_open_shm(pa_fdsem_data *data, int event_fd) {
return f;
}
-pa_fdsem *pa_fdsem_new_shm(pa_fdsem_data *data, int* event_fd) {
+pa_fdsem *pa_fdsem_new_shm(pa_fdsem_data *data) {
pa_fdsem *f = NULL;
pa_assert(data);
- pa_assert(event_fd);
#ifdef HAVE_SYS_EVENTFD_H
diff --git a/src/pulsecore/fdsem.h b/src/pulsecore/fdsem.h
index a434ac3..3f1d9a1 100644
--- a/src/pulsecore/fdsem.h
+++ b/src/pulsecore/fdsem.h
@@ -38,7 +38,7 @@ typedef struct pa_fdsem_data {
pa_fdsem *pa_fdsem_new(void);
pa_fdsem *pa_fdsem_open_shm(pa_fdsem_data *data, int event_fd);
-pa_fdsem *pa_fdsem_new_shm(pa_fdsem_data *data, int* event_fd);
+pa_fdsem *pa_fdsem_new_shm(pa_fdsem_data *data);
void pa_fdsem_free(pa_fdsem *f);
void pa_fdsem_post(pa_fdsem *f);
diff --git a/src/pulsecore/shmasyncq.c b/src/pulsecore/shmasyncq.c
index e6599a9..8d3c447 100644
--- a/src/pulsecore/shmasyncq.c
+++ b/src/pulsecore/shmasyncq.c
@@ -86,10 +86,11 @@ pa_shmasyncq *pa_shmasyncq_new(unsigned n_elements, size_t element_size, void *d
l->data->n_elements = n_elements;
l->data->element_size = element_size;
- if (!(l->read_fdsem = pa_fdsem_new_shm(&d->read_fdsem_data, &fd[0]))) {
+ if (!(l->read_fdsem = pa_fdsem_new_shm(&d->read_fdsem_data))) {
pa_xfree(l);
return NULL;
}
+ fd[0] = pa_fdsem_get(l->read_fdsem);
if (!(l->write_fdsem = pa_fdsem_new(&d->write_fdsem_data, &fd[1]))) {
pa_fdsem_free(l->read_fdsem);
More information about the pulseaudio-commits
mailing list