]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "runtime: correct GoCheckBindM's C declaration in EnsureBindM test"
authorMichael Pratt <mpratt@google.com>
Mon, 17 Apr 2023 18:12:25 +0000 (14:12 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 17 Apr 2023 18:46:31 +0000 (18:46 +0000)
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>

src/runtime/testdata/testprogcgo/bindm.c [deleted file]
src/runtime/testdata/testprogcgo/bindm.go

diff --git a/src/runtime/testdata/testprogcgo/bindm.c b/src/runtime/testdata/testprogcgo/bindm.c
deleted file mode 100644 (file)
index 815d8a7..0000000
+++ /dev/null
@@ -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);
-       }
-}
index c2003c2093150af5455912316a94b14381477480..ed2c6a7eeaa053c9a028b08045f5c8f5c9c5fcbf 100644 (file)
 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"