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
c0ce8337
Commit
c0ce8337
authored
Jan 20, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl: Use YieldProcessor().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6bdf6411
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
12 deletions
+3
-12
sync.c
dlls/ntoskrnl.exe/sync.c
+3
-12
No files found.
dlls/ntoskrnl.exe/sync.c
View file @
c0ce8337
...
...
@@ -540,15 +540,6 @@ void WINAPI KeInitializeSpinLock( KSPIN_LOCK *lock )
*
lock
=
0
;
}
static
inline
void
small_pause
(
void
)
{
#ifdef __x86_64__
__asm__
__volatile__
(
"rep;nop"
:
:
:
"memory"
);
#else
__asm__
__volatile__
(
""
:
:
:
"memory"
);
#endif
}
/***********************************************************************
* KeAcquireSpinLockAtDpcLevel (NTOSKRNL.EXE.@)
*/
...
...
@@ -556,7 +547,7 @@ void WINAPI KeAcquireSpinLockAtDpcLevel( KSPIN_LOCK *lock )
{
TRACE
(
"lock %p.
\n
"
,
lock
);
while
(
InterlockedCompareExchangePointer
(
(
void
**
)
lock
,
(
void
*
)
1
,
(
void
*
)
0
))
small_pause
();
YieldProcessor
();
}
/***********************************************************************
...
...
@@ -592,7 +583,7 @@ void FASTCALL KeAcquireInStackQueuedSpinLockAtDpcLevel( KSPIN_LOCK *lock, KLOCK_
while
(
!
((
ULONG_PTR
)
InterlockedCompareExchangePointer
(
(
void
**
)
&
queue
->
LockQueue
.
Lock
,
0
,
0
)
&
QUEUED_SPINLOCK_OWNED
))
{
small_pause
();
YieldProcessor
();
}
}
}
...
...
@@ -619,7 +610,7 @@ void FASTCALL KeReleaseInStackQueuedSpinLockFromDpcLevel( KLOCK_QUEUE_HANDLE *qu
/* Otherwise, someone just queued themselves, but hasn't yet set
* themselves as successor. Spin waiting for them to do so. */
while
(
!
(
next
=
queue
->
LockQueue
.
Next
))
small_pause
();
YieldProcessor
();
}
InterlockedExchangePointer
(
(
void
**
)
&
next
->
Lock
,
(
KSPIN_LOCK
*
)((
ULONG_PTR
)
lock
|
QUEUED_SPINLOCK_OWNED
)
);
...
...
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