Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
57493fdd
Commit
57493fdd
authored
Aug 03, 2011
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Aug 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use FUTEX_PRIVATE_FLAG for critical section futexes when available.
parent
e1ae573d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
critsection.c
dlls/ntdll/critsection.c
+11
-2
No files found.
dlls/ntdll/critsection.c
View file @
57493fdd
...
...
@@ -61,14 +61,17 @@ static inline void small_pause(void)
#ifdef __linux__
static
int
wait_op
=
128
;
/*FUTEX_WAIT|FUTEX_PRIVATE_FLAG*/
static
int
wake_op
=
129
;
/*FUTEX_WAKE|FUTEX_PRIVATE_FLAG*/
static
inline
int
futex_wait
(
int
*
addr
,
int
val
,
struct
timespec
*
timeout
)
{
return
syscall
(
SYS_futex
,
addr
,
0
/*FUTEX_WAIT*/
,
val
,
timeout
,
0
,
0
);
return
syscall
(
SYS_futex
,
addr
,
wait_op
,
val
,
timeout
,
0
,
0
);
}
static
inline
int
futex_wake
(
int
*
addr
,
int
val
)
{
return
syscall
(
SYS_futex
,
addr
,
1
/*FUTEX_WAKE*/
,
val
,
NULL
,
0
,
0
);
return
syscall
(
SYS_futex
,
addr
,
wake_op
,
val
,
NULL
,
0
,
0
);
}
static
inline
int
use_futexes
(
void
)
...
...
@@ -78,6 +81,12 @@ static inline int use_futexes(void)
if
(
supported
==
-
1
)
{
futex_wait
(
&
supported
,
10
,
NULL
);
if
(
errno
==
ENOSYS
)
{
wait_op
=
0
;
/*FUTEX_WAIT*/
wake_op
=
1
;
/*FUTEX_WAKE*/
futex_wait
(
&
supported
,
10
,
NULL
);
}
supported
=
(
errno
!=
ENOSYS
);
}
return
supported
;
...
...
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