mirror of
https://github.com/golang/go.git
synced 2026-06-27 19:30:52 +00:00
runtime/cgo: add acquire/release back around malloc
This was accidentally dropped in CL 746300. Fixes #67800. Fixes #78479. Change-Id: If78ba91fbdc2ab67d48c9200e5c7a9706a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/775920 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com> Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
373b3a9097
commit
c7d87cda53
1 changed files with 2 additions and 0 deletions
|
|
@ -185,7 +185,9 @@ x_cgo_thread_start(ThreadStart *arg)
|
|||
ThreadStart *ts;
|
||||
|
||||
/* Make our own copy that can persist after we return. */
|
||||
_cgo_tsan_acquire();
|
||||
ts = malloc(sizeof *ts);
|
||||
_cgo_tsan_release();
|
||||
if(ts == nil) {
|
||||
fprintf(stderr, "runtime/cgo: out of memory in thread_start\n");
|
||||
abort();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue