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
8ca96a9d
Commit
8ca96a9d
authored
Jan 21, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Throw STATUS_RESOURCE_NOT_OWNED when it's impossible to acquire/release the SRWLock.
parent
77f871ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
sync.c
dlls/ntdll/sync.c
+10
-0
No files found.
dlls/ntdll/sync.c
View file @
8ca96a9d
...
...
@@ -1435,6 +1435,14 @@ DWORD WINAPI RtlRunOnceExecuteOnce( RTL_RUN_ONCE *once, PRTL_RUN_ONCE_INIT_FN fu
#define srwlock_key_shared(lock) (&lock->Ptr)
#endif
static
inline
void
srwlock_check_invalid
(
unsigned
int
val
)
{
/* Throw exception if it's impossible to acquire/release this lock. */
if
((
val
&
SRWLOCK_MASK_EXCLUSIVE_QUEUE
)
==
SRWLOCK_MASK_EXCLUSIVE_QUEUE
||
(
val
&
SRWLOCK_MASK_SHARED_QUEUE
)
==
SRWLOCK_MASK_SHARED_QUEUE
)
RtlRaiseStatus
(
STATUS_RESOURCE_NOT_OWNED
);
}
static
inline
unsigned
int
srwlock_lock_exclusive
(
unsigned
int
*
dest
,
int
incr
)
{
unsigned
int
val
,
tmp
;
...
...
@@ -1445,6 +1453,7 @@ static inline unsigned int srwlock_lock_exclusive( unsigned int *dest, int incr
for
(
val
=
*
dest
;;
val
=
tmp
)
{
tmp
=
val
+
incr
;
srwlock_check_invalid
(
tmp
);
if
((
tmp
&
SRWLOCK_MASK_EXCLUSIVE_QUEUE
)
&&
!
(
tmp
&
SRWLOCK_MASK_SHARED_QUEUE
))
tmp
|=
SRWLOCK_MASK_IN_EXCLUSIVE
;
if
((
tmp
=
interlocked_cmpxchg
(
(
int
*
)
dest
,
tmp
,
val
))
==
val
)
...
...
@@ -1463,6 +1472,7 @@ static inline unsigned int srwlock_unlock_exclusive( unsigned int *dest, int inc
for
(
val
=
*
dest
;;
val
=
tmp
)
{
tmp
=
val
+
incr
;
srwlock_check_invalid
(
tmp
);
if
(
!
(
tmp
&
SRWLOCK_MASK_EXCLUSIVE_QUEUE
))
tmp
&=
SRWLOCK_MASK_SHARED_QUEUE
;
if
((
tmp
=
interlocked_cmpxchg
(
(
int
*
)
dest
,
tmp
,
val
))
==
val
)
...
...
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