mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
Allocate rtsigs from back to front, to avoid clashes with other libraries makeing use of rtsigs
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1913 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
df33b4c7b3
commit
3cdff5f3cc
1 changed files with 13 additions and 12 deletions
|
|
@ -54,13 +54,13 @@ int pa_rtsig_get(void) {
|
||||||
if ((p = pa_flist_pop(PA_STATIC_FLIST_GET(rtsig_flist))))
|
if ((p = pa_flist_pop(PA_STATIC_FLIST_GET(rtsig_flist))))
|
||||||
return PA_PTR_TO_INT(p);
|
return PA_PTR_TO_INT(p);
|
||||||
|
|
||||||
sig = pa_atomic_inc(&rtsig_current);
|
sig = pa_atomic_dec(&rtsig_current);
|
||||||
|
|
||||||
pa_assert(sig >= SIGRTMIN);
|
pa_assert(sig <= SIGRTMAX);
|
||||||
pa_assert(sig >= rtsig_start);
|
pa_assert(sig <= rtsig_end);
|
||||||
|
|
||||||
if (sig > rtsig_end) {
|
if (sig < rtsig_start) {
|
||||||
pa_atomic_dec(&rtsig_current);
|
pa_atomic_inc(&rtsig_current);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,5 +108,6 @@ void pa_rtsig_configure(int start, int end) {
|
||||||
|
|
||||||
pa_assert(pthread_sigmask(SIG_BLOCK, &ss, NULL) == 0);
|
pa_assert(pthread_sigmask(SIG_BLOCK, &ss, NULL) == 0);
|
||||||
|
|
||||||
pa_atomic_store(&rtsig_current, rtsig_start);
|
/* We allocate starting from the end */
|
||||||
|
pa_atomic_store(&rtsig_current, rtsig_end);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue