tsan: deflake more tests

llvm-svn: 195913
This commit is contained in:
Dmitry Vyukov 2013-11-28 09:06:55 +00:00
parent e7255da917
commit 0fea3ad0c7
2 changed files with 4 additions and 0 deletions

View File

@ -1,10 +1,12 @@
// RUN: %clangxx_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s // RUN: %clangxx_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
const long kOffset = 64*1024; const long kOffset = 64*1024;
void *Thread(void *p) { void *Thread(void *p) {
sleep(1);
((char*)p)[-kOffset] = 43; ((char*)p)[-kOffset] = 43;
return 0; return 0;
} }

View File

@ -5,11 +5,13 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h>
int fd; int fd;
char buf; char buf;
void *Thread(void *x) { void *Thread(void *x) {
sleep(1);
read(fd, &buf, 1); read(fd, &buf, 1);
return NULL; return NULL;
} }