Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
67641a81
Commit
67641a81
authored
Feb 21, 2004
by
Jaroslav Kysela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA CVS update - Takashi Iwai <tiwai@suse.de>
ALSA sequencer - fixed the race conditions.
parent
04fa6b4f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
sound/core/seq/seq_fifo.c
sound/core/seq/seq_fifo.c
+9
-5
sound/core/seq/seq_memory.c
sound/core/seq/seq_memory.c
+8
-3
No files found.
sound/core/seq/seq_fifo.c
View file @
67641a81
...
...
@@ -171,10 +171,12 @@ int snd_seq_fifo_cell_out(fifo_t *f, snd_seq_event_cell_t **cellp, int nonblock)
{
snd_seq_event_cell_t
*
cell
;
unsigned
long
flags
;
wait_queue_t
wait
;
snd_assert
(
f
!=
NULL
,
return
-
EINVAL
);
*
cellp
=
NULL
;
init_waitqueue_entry
(
&
wait
,
current
);
spin_lock_irqsave
(
&
f
->
lock
,
flags
);
while
((
cell
=
fifo_cell_out
(
f
))
==
NULL
)
{
if
(
nonblock
)
{
...
...
@@ -182,17 +184,19 @@ int snd_seq_fifo_cell_out(fifo_t *f, snd_seq_event_cell_t **cellp, int nonblock)
spin_unlock_irqrestore
(
&
f
->
lock
,
flags
);
return
-
EAGAIN
;
}
spin_unlock
(
&
f
->
lock
);
interruptible_sleep_on
(
&
f
->
input_sleep
);
spin_lock
(
&
f
->
lock
);
set_current_state
(
TASK_INTERRUPTIBLE
);
add_wait_queue
(
&
f
->
input_sleep
,
&
wait
);
spin_unlock_irq
(
&
f
->
lock
);
schedule
();
spin_lock_irq
(
&
f
->
lock
);
remove_wait_queue
(
&
f
->
input_sleep
,
&
wait
);
if
(
signal_pending
(
current
))
{
spin_unlock_irqrestore
(
&
f
->
lock
,
flags
);
return
-
ERESTARTSYS
;
}
}
*
cellp
=
cell
;
spin_unlock_irqrestore
(
&
f
->
lock
,
flags
);
*
cellp
=
cell
;
return
0
;
}
...
...
sound/core/seq/seq_memory.c
View file @
67641a81
...
...
@@ -220,12 +220,14 @@ int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock,
snd_seq_event_cell_t
*
cell
;
unsigned
long
flags
;
int
err
=
-
EAGAIN
;
wait_queue_t
wait
;
if
(
pool
==
NULL
)
return
-
EINVAL
;
*
cellp
=
NULL
;
init_waitqueue_entry
(
&
wait
,
current
);
spin_lock_irqsave
(
&
pool
->
lock
,
flags
);
if
(
pool
->
ptr
==
NULL
)
{
/* not initialized */
snd_printd
(
"seq: pool is not initialized
\n
"
);
...
...
@@ -234,9 +236,12 @@ int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock,
}
while
(
pool
->
free
==
NULL
&&
!
nonblock
&&
!
pool
->
closing
)
{
spin_unlock
(
&
pool
->
lock
);
interruptible_sleep_on
(
&
pool
->
output_sleep
);
spin_lock
(
&
pool
->
lock
);
set_current_state
(
TASK_INTERRUPTIBLE
);
add_wait_queue
(
&
pool
->
output_sleep
,
&
wait
);
spin_unlock_irq
(
&
pool
->
lock
);
schedule
();
spin_lock_irq
(
&
pool
->
lock
);
remove_wait_queue
(
&
pool
->
output_sleep
,
&
wait
);
/* interrupted? */
if
(
signal_pending
(
current
))
{
err
=
-
ERESTARTSYS
;
...
...
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