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
0d1345ac
Commit
0d1345ac
authored
Jan 20, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Add InterlockedAnd().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
275b2226
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
lock.c
dlls/msvcrt/lock.c
+0
-10
winnt.h
include/winnt.h
+12
-0
No files found.
dlls/msvcrt/lock.c
View file @
0d1345ac
...
...
@@ -1157,16 +1157,6 @@ static inline void spin_wait_for_next_rwl(rwl_queue *q)
SpinWait_dtor
(
&
sw
);
}
static
LONG
InterlockedAnd
(
LONG
*
d
,
LONG
v
)
{
LONG
l
=
*
d
,
old
;
while
((
l
&
v
)
!=
l
)
{
if
((
old
=
InterlockedCompareExchange
(
d
,
l
&
v
,
l
))
==
l
)
break
;
l
=
old
;
}
return
l
;
}
/* ?lock@reader_writer_lock@Concurrency@@QAEXXZ */
/* ?lock@reader_writer_lock@Concurrency@@QEAAXXZ */
DEFINE_THISCALL_WRAPPER
(
reader_writer_lock_lock
,
4
)
...
...
include/winnt.h
View file @
0d1345ac
...
...
@@ -6896,6 +6896,7 @@ static inline BOOLEAN BitScanReverse(DWORD *index, DWORD mask)
#ifdef _MSC_VER
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedCompareExchange)
#pragma intrinsic(_InterlockedCompareExchange64)
#ifdef _WIN64
...
...
@@ -6907,6 +6908,7 @@ static inline BOOLEAN BitScanReverse(DWORD *index, DWORD mask)
#pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedOr)
long
_InterlockedAnd
(
long
volatile
*
,
long
);
long
_InterlockedCompareExchange
(
long
volatile
*
,
long
,
long
);
long
long
_InterlockedCompareExchange64
(
long
long
volatile
*
,
long
long
,
long
long
);
#ifdef _WIN64
...
...
@@ -6918,6 +6920,11 @@ long _InterlockedExchangeAdd(long volatile*,long);
long
_InterlockedIncrement
(
long
volatile
*
);
long
_InterlockedOr
(
long
volatile
*
,
long
);
static
FORCEINLINE
LONG
WINAPI
InterlockedAnd
(
LONG
volatile
*
dest
,
LONG
val
)
{
return
_InterlockedAnd
(
(
long
volatile
*
)
dest
,
val
);
}
static
FORCEINLINE
LONG
WINAPI
InterlockedCompareExchange
(
LONG
volatile
*
dest
,
LONG
xchg
,
LONG
compare
)
{
return
_InterlockedCompareExchange
(
(
long
volatile
*
)
dest
,
xchg
,
compare
);
...
...
@@ -7030,6 +7037,11 @@ static FORCEINLINE void MemoryBarrier(void)
#elif defined(__GNUC__)
static
FORCEINLINE
LONG
WINAPI
InterlockedAnd
(
LONG
volatile
*
dest
,
LONG
val
)
{
return
__sync_fetch_and_and
(
dest
,
val
);
}
static
FORCEINLINE
LONG
WINAPI
InterlockedCompareExchange
(
LONG
volatile
*
dest
,
LONG
xchg
,
LONG
compare
)
{
return
__sync_val_compare_and_swap
(
dest
,
compare
,
xchg
);
...
...
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