Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
34b218e8
Commit
34b218e8
authored
Nov 27, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: fix critical section
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
ad8c6ca7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
wrnc-core.c
kernel/wrnc-core.c
+5
-3
No files found.
kernel/wrnc-core.c
View file @
34b218e8
...
...
@@ -981,13 +981,15 @@ static int wrnc_ioctl_msg_sync(struct wrnc_hmq *hmq, void __user *uarg)
/*
* Wait until the message queue is empty so we can safely enqueue
* the synchronous message. Then get the mutex to avoid other process
* to write
* the synchronous message. Get the mutex to avoid other process
* to write while we are waiting to empty the list.
* Sync messages does not have higher priority than the others, so
* we'll wait here until is our turn
*/
mutex_lock
(
&
hmq
->
mtx
);
to
=
wait_event_interruptible
(
hmq
->
q_msg
,
list_empty
(
&
hmq
->
list_msg
));
if
(
unlikely
(
to
<
0
))
goto
out
;
mutex_lock
(
&
hmq
->
mtx
);
/*
* Wait for the CPU-out queue is empty. Then get the mutex to avoid
...
...
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