Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ae8408f1
Commit
ae8408f1
authored
May 12, 2015
by
Grazvydas Ignotas
Committed by
Alexandre Julliard
May 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port.h: Make use of compiler support for 64bit atomic ops.
parent
4419edd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
port.h
include/wine/port.h
+9
-3
interlocked.c
libs/port/interlocked.c
+2
-0
No files found.
include/wine/port.h
View file @
ae8408f1
...
...
@@ -367,8 +367,6 @@ extern int _spawnvp(int mode, const char *cmdname, const char * const argv[]);
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
extern
__int64
interlocked_cmpxchg64
(
__int64
*
dest
,
__int64
xchg
,
__int64
compare
);
static
inline
int
interlocked_cmpxchg
(
int
*
dest
,
int
xchg
,
int
compare
)
{
int
ret
;
...
...
@@ -459,7 +457,6 @@ extern int interlocked_xchg( int *dest, int val );
#endif
extern
void
*
interlocked_cmpxchg_ptr
(
void
**
dest
,
void
*
xchg
,
void
*
compare
);
extern
__int64
interlocked_cmpxchg64
(
__int64
*
dest
,
__int64
xchg
,
__int64
compare
);
extern
void
*
interlocked_xchg_ptr
(
void
**
dest
,
void
*
val
);
#if defined(__x86_64__) || defined(__aarch64__) || defined(_WIN64)
extern
unsigned
char
interlocked_cmpxchg128
(
__int64
*
dest
,
__int64
xchg_high
,
...
...
@@ -468,6 +465,15 @@ extern unsigned char interlocked_cmpxchg128( __int64 *dest, __int64 xchg_high,
#endif
/* __GNUC__ */
#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
static
inline
__int64
interlocked_cmpxchg64
(
__int64
*
dest
,
__int64
xchg
,
__int64
compare
)
{
return
__sync_val_compare_and_swap
(
dest
,
compare
,
xchg
);
}
#else
extern
__int64
interlocked_cmpxchg64
(
__int64
*
dest
,
__int64
xchg
,
__int64
compare
);
#endif
#else
/* NO_LIBWINE_PORT */
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
...
...
libs/port/interlocked.c
View file @
ae8408f1
...
...
@@ -302,6 +302,7 @@ void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare )
return
compare
;
}
#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
__int64
interlocked_cmpxchg64
(
__int64
*
dest
,
__int64
xchg
,
__int64
compare
)
{
pthread_mutex_lock
(
&
interlocked_mutex
);
...
...
@@ -314,6 +315,7 @@ __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compare )
pthread_mutex_unlock
(
&
interlocked_mutex
);
return
compare
;
}
#endif
#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
int
interlocked_xchg
(
int
*
dest
,
int
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