diff options
| author | Ian Lance Taylor <iant@golang.org> | 2016-08-02 11:42:53 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2016-08-23 14:07:58 +0000 |
| commit | 2d85e87f08c325f8be869718c4ac0d7c069161c0 (patch) | |
| tree | 7f1467cbefb05c20897dd118ebfb4a95ccc80406 /src/runtime | |
| parent | 0889d2d04a0ab8c4a0d6c437c857f3f721818577 (diff) | |
| download | go-2d85e87f08c325f8be869718c4ac0d7c069161c0.tar.xz | |
runtime/cgo: add tsan acquire/release around setenv/unsetenv
Change-Id: Iabb25e97714d070c31c657559a97a3bfc979da18
Reviewed-on: https://go-review.googlesource.com/25403
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/cgo/gcc_setenv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/cgo/gcc_setenv.c b/src/runtime/cgo/gcc_setenv.c index 8708d400ef..ed5d203fb0 100644 --- a/src/runtime/cgo/gcc_setenv.c +++ b/src/runtime/cgo/gcc_setenv.c @@ -13,12 +13,16 @@ void x_cgo_setenv(char **arg) { + _cgo_tsan_acquire(); setenv(arg[0], arg[1], 1); + _cgo_tsan_release(); } /* Stub for calling unsetenv */ void x_cgo_unsetenv(char *arg) { + _cgo_tsan_acquire(); unsetenv(arg); + _cgo_tsan_release(); } |
