Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
8ba5c559
Commit
8ba5c559
authored
Feb 23, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: work around Linux kernel bug in futex
Fixes #420. R=r CC=golang-dev
https://golang.org/cl/218065
parent
5c2197ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
thread.c
src/pkg/runtime/linux/thread.c
+6
-14
No files found.
src/pkg/runtime/linux/thread.c
View file @
8ba5c559
...
...
@@ -42,20 +42,12 @@ static Timespec longtime =
static
void
futexsleep
(
uint32
*
addr
,
uint32
val
)
{
int32
ret
;
ret
=
futex
(
addr
,
FUTEX_WAIT
,
val
,
&
longtime
,
nil
,
0
);
if
(
ret
>=
0
||
ret
==
-
EAGAIN
||
ret
==
-
EINTR
)
return
;
prints
(
"futexsleep addr="
);
·
printpointer
(
addr
);
prints
(
" val="
);
·
printint
(
val
);
prints
(
" returned "
);
·
printint
(
ret
);
prints
(
"
\n
"
);
*
(
int32
*
)
0x1005
=
0x1005
;
// Some Linux kernels have a bug where futex of
// FUTEX_WAIT returns an internal error code
// as an errno. Libpthread ignores the return value
// here, and so can we: as it says a few lines up,
// spurious wakeups are allowed.
futex
(
addr
,
FUTEX_WAIT
,
val
,
&
longtime
,
nil
,
0
);
}
// If any procs are sleeping on addr, wake up at least one.
...
...
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