Skip to content

Commit 97e5ca6

Browse files
prattmicgopherbot
authored andcommitted
Revert "runtime: correct GoCheckBindM's C declaration in EnsureBindM test"
This reverts CL 482975. Reason for revert: CL 481061 causes C TSAN failures and must be reverted. See CL 485275. This CL depends on CL 481061. For #59678. Change-Id: I4599e93d536149bcec94a5a1542533107699514f Reviewed-on: https://go-review.googlesource.com/c/go/+/485317 Reviewed-by: Than McIntosh <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Michael Pratt <[email protected]> Auto-Submit: Michael Pratt <[email protected]>
1 parent 2068d56 commit 97e5ca6

File tree

2 files changed

+29
-35
lines changed

2 files changed

+29
-35
lines changed

src/runtime/testdata/testprogcgo/bindm.c

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/runtime/testdata/testprogcgo/bindm.go

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,35 @@
1010
package main
1111

1212
/*
13-
extern void CheckBindM();
13+
#include <stdint.h>
14+
#include <pthread.h>
15+
#include <unistd.h>
16+
17+
extern void GoCheckBindM();
18+
19+
#define CTHREADS 2
20+
#define CHECKCALLS 100
21+
22+
static void* checkBindMThread(void* thread) {
23+
int i;
24+
for (i = 0; i < CHECKCALLS; i++) {
25+
GoCheckBindM((uintptr_t)thread);
26+
usleep(1);
27+
}
28+
return NULL;
29+
}
30+
31+
static void CheckBindM() {
32+
int i;
33+
pthread_t s[CTHREADS];
34+
35+
for (i = 0; i < CTHREADS; i++) {
36+
pthread_create(&s[i], NULL, checkBindMThread, &s[i]);
37+
}
38+
for (i = 0; i < CTHREADS; i++) {
39+
pthread_join(s[i], NULL);
40+
}
41+
}
1442
*/
1543
import "C"
1644

0 commit comments

Comments
 (0)