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
fad29fc5
Commit
fad29fc5
authored
Jan 22, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlSleepConditionVariableSRW.
parent
e7b3a437
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
sync.c
dlls/ntdll/sync.c
+44
-0
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
fad29fc5
...
...
@@ -869,6 +869,7 @@
@ stub RtlSetUserValueHeap
@ stdcall RtlSizeHeap(long long ptr)
@ stdcall RtlSleepConditionVariableCS(ptr ptr ptr)
@ stdcall RtlSleepConditionVariableSRW(ptr ptr ptr long)
@ stub RtlSplay
@ stub RtlStartRXact
# @ stub RtlStatMemoryStream
...
...
dlls/ntdll/sync.c
View file @
fad29fc5
...
...
@@ -1696,3 +1696,47 @@ NTSTATUS WINAPI RtlSleepConditionVariableCS( RTL_CONDITION_VARIABLE *variable, R
RtlEnterCriticalSection
(
crit
);
return
status
;
}
/***********************************************************************
* RtlSleepConditionVariableSRW (NTDLL.@)
*
* Atomically releases the SRWLock and suspends the thread,
* waiting for a Wake(All)ConditionVariable event. Afterwards it enters
* the SRWLock again with the same access rights and returns.
*
* PARAMS
* variable [I/O] condition variable
* lock [I/O] SRWLock to leave temporarily
* timeout [I] timeout
* flags [I] type of the current lock (exclusive / shared)
*
* RETURNS
* see NtWaitForKeyedEvent for all possible return values.
*
* NOTES
* the behaviour is undefined if the thread doesn't own the lock.
*/
NTSTATUS
WINAPI
RtlSleepConditionVariableSRW
(
RTL_CONDITION_VARIABLE
*
variable
,
RTL_SRWLOCK
*
lock
,
const
LARGE_INTEGER
*
timeout
,
ULONG
flags
)
{
NTSTATUS
status
;
interlocked_xchg_add
(
(
int
*
)
&
variable
->
Ptr
,
1
);
if
(
flags
&
RTL_CONDITION_VARIABLE_LOCKMODE_SHARED
)
RtlReleaseSRWLockShared
(
lock
);
else
RtlReleaseSRWLockExclusive
(
lock
);
status
=
NtWaitForKeyedEvent
(
keyed_event
,
&
variable
->
Ptr
,
FALSE
,
timeout
);
if
(
status
!=
STATUS_SUCCESS
)
{
if
(
!
interlocked_dec_if_nonzero
(
(
int
*
)
&
variable
->
Ptr
))
status
=
NtWaitForKeyedEvent
(
keyed_event
,
&
variable
->
Ptr
,
FALSE
,
NULL
);
}
if
(
flags
&
RTL_CONDITION_VARIABLE_LOCKMODE_SHARED
)
RtlAcquireSRWLockShared
(
lock
);
else
RtlAcquireSRWLockExclusive
(
lock
);
return
status
;
}
include/winternl.h
View file @
fad29fc5
...
...
@@ -2503,6 +2503,7 @@ NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
NTSYSAPI
NTSTATUS
WINAPI
RtlSetTimeZoneInformation
(
const
RTL_TIME_ZONE_INFORMATION
*
);
NTSYSAPI
SIZE_T
WINAPI
RtlSizeHeap
(
HANDLE
,
ULONG
,
const
void
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlSleepConditionVariableCS
(
RTL_CONDITION_VARIABLE
*
,
RTL_CRITICAL_SECTION
*
,
const
LARGE_INTEGER
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlSleepConditionVariableSRW
(
RTL_CONDITION_VARIABLE
*
,
RTL_SRWLOCK
*
,
const
LARGE_INTEGER
*
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
RtlStringFromGUID
(
REFGUID
,
PUNICODE_STRING
);
NTSYSAPI
LPDWORD
WINAPI
RtlSubAuthoritySid
(
PSID
,
DWORD
);
NTSYSAPI
LPBYTE
WINAPI
RtlSubAuthorityCountSid
(
PSID
);
...
...
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