Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
09012c2f
Commit
09012c2f
authored
Dec 20, 2007
by
serg@janus.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
my_atomic-t.c:
gcc bug workaround
parent
d9ca7b67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
unittest/mysys/my_atomic-t.c
unittest/mysys/my_atomic-t.c
+9
-2
No files found.
unittest/mysys/my_atomic-t.c
View file @
09012c2f
...
...
@@ -18,6 +18,13 @@
#include <my_atomic.h>
#include <tap.h>
/* at least gcc 3.4.5 and 3.4.6 (but not 3.2.3) on RHEL */
#if __GNUC__ == 3 && __GNUC_MINOR__ == 4
#define GCC_BUG_WORKAROUND volatile
#else
#define GCC_BUG_WORKAROUND
#endif
int32
a32
,
b32
,
c32
;
my_atomic_rwlock_t
rwl
;
...
...
@@ -30,7 +37,7 @@ int N;
pthread_handler_t
test_atomic_add_handler
(
void
*
arg
)
{
int
m
=*
(
int
*
)
arg
;
int32
x
;
GCC_BUG_WORKAROUND
int32
x
;
for
(
x
=
((
int
)((
long
)(
&
m
)));
m
;
m
--
)
{
x
=
x
*
m
+
0x87654321
;
...
...
@@ -102,7 +109,7 @@ pthread_handler_t test_atomic_swap_handler(void *arg)
pthread_handler_t
test_atomic_cas_handler
(
void
*
arg
)
{
int
m
=*
(
int
*
)
arg
,
ok
;
int32
x
,
y
;
GCC_BUG_WORKAROUND
int32
x
,
y
;
for
(
x
=
((
int
)((
long
)(
&
m
)));
m
;
m
--
)
{
my_atomic_rwlock_wrlock
(
&
rwl
);
...
...
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