1
0
mirror of https://github.com/golang/go synced 2024-11-26 18:16:48 -07:00

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 <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
Michael Pratt 2023-04-17 14:12:25 -04:00 committed by Gopher Robot
parent 2068d5658e
commit 97e5ca6d4e
2 changed files with 29 additions and 35 deletions

View File

@ -1,34 +0,0 @@
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !plan9 && !windows
#include <stdint.h>
#include <pthread.h>
#include <unistd.h>
#include "_cgo_export.h"
#define CTHREADS 2
#define CHECKCALLS 100
static void* checkBindMThread(void* thread) {
int i;
for (i = 0; i < CHECKCALLS; i++) {
GoCheckBindM((uintptr_t)thread);
usleep(1);
}
return NULL;
}
void CheckBindM() {
int i;
pthread_t s[CTHREADS];
for (i = 0; i < CTHREADS; i++) {
pthread_create(&s[i], NULL, checkBindMThread, &s[i]);
}
for (i = 0; i < CTHREADS; i++) {
pthread_join(s[i], NULL);
}
}

View File

@ -10,7 +10,35 @@
package main
/*
extern void CheckBindM();
#include <stdint.h>
#include <pthread.h>
#include <unistd.h>
extern void GoCheckBindM();
#define CTHREADS 2
#define CHECKCALLS 100
static void* checkBindMThread(void* thread) {
int i;
for (i = 0; i < CHECKCALLS; i++) {
GoCheckBindM((uintptr_t)thread);
usleep(1);
}
return NULL;
}
static void CheckBindM() {
int i;
pthread_t s[CTHREADS];
for (i = 0; i < CTHREADS; i++) {
pthread_create(&s[i], NULL, checkBindMThread, &s[i]);
}
for (i = 0; i < CTHREADS; i++) {
pthread_join(s[i], NULL);
}
}
*/
import "C"