parent
e7255da917
commit
0fea3ad0c7
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue