|
From: <sv...@va...> - 2014-05-17 10:44:09
|
Author: bart
Date: Sat May 17 10:44:00 2014
New Revision: 13980
Log:
drd/tests/atomic_var: Revert r13876.
r13876 was a workaround for false ordering introduced by platform-specific
(Solaris) code. The conclusion of an off-list discussion was that this has
to be solved in the drd tool itself and not by modifying test programs. Hence
this revert.
Modified:
trunk/drd/tests/atomic_var.c
trunk/drd/tests/atomic_var.stderr.exp
trunk/drd/tests/atomic_var.vgtest
Modified: trunk/drd/tests/atomic_var.c
==============================================================================
--- trunk/drd/tests/atomic_var.c (original)
+++ trunk/drd/tests/atomic_var.c Sat May 17 10:44:00 2014
@@ -23,8 +23,6 @@
has built-in functions for atomic memory access.
#endif
-static pthread_barrier_t s_barrier;
-
static __inline__
int sync_add_and_fetch(int* p, int i)
{
@@ -38,7 +36,6 @@
static void* thread_func_1(void* arg)
{
- pthread_barrier_wait(&s_barrier);
s_y = 1;
(void) sync_add_and_fetch(&s_x, 1);
return 0;
@@ -46,7 +43,6 @@
static void* thread_func_2(void* arg)
{
- pthread_barrier_wait(&s_barrier);
while (sync_add_and_fetch(&s_x, 0) == 0)
;
fprintf(stderr, "y = %d\n", s_y);
@@ -60,12 +56,10 @@
pthread_t tid[n_threads];
fprintf(stderr, "Start of test.\n");
- pthread_barrier_init(&s_barrier, 0, 2);
pthread_create(&tid[0], 0, thread_func_1, 0);
pthread_create(&tid[1], 0, thread_func_2, 0);
for (i = 0; i < n_threads; i++)
pthread_join(tid[i], 0);
- pthread_barrier_destroy(&s_barrier);
fprintf(stderr, "Test finished.\n");
return 0;
Modified: trunk/drd/tests/atomic_var.stderr.exp
==============================================================================
--- trunk/drd/tests/atomic_var.stderr.exp (original)
+++ trunk/drd/tests/atomic_var.stderr.exp Sat May 17 10:44:00 2014
@@ -4,7 +4,7 @@
at 0x........: thread_func_2 (atomic_var.c:?)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Location 0x........ is 0 bytes inside global var "s_y"
-declared at atomic_var.c:37
+declared at atomic_var.c:35
y = 1
Test finished.
Modified: trunk/drd/tests/atomic_var.vgtest
==============================================================================
--- trunk/drd/tests/atomic_var.vgtest (original)
+++ trunk/drd/tests/atomic_var.vgtest Sat May 17 10:44:00 2014
@@ -1,4 +1,4 @@
prereq: test -e atomic_var && ./supported_libpthread
-vgopts: --fair-sched=yes --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=2
+vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=2
prog: atomic_var
stderr_filter: filter_stderr_and_thread_no
|