mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime/cgo: check for errors from pthread_create
R=rsc, iant, dvyukov CC=golang-dev https://golang.org/cl/4643057
This commit is contained in:
parent
660b22988b
commit
a026d0fc76
7 changed files with 47 additions and 8 deletions
|
|
@ -20,11 +20,16 @@ libcgo_sys_thread_start(ThreadStart *ts)
|
|||
pthread_attr_t attr;
|
||||
pthread_t p;
|
||||
size_t size;
|
||||
int err;
|
||||
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_getstacksize(&attr, &size);
|
||||
ts->g->stackguard = size;
|
||||
pthread_create(&p, &attr, threadentry, ts);
|
||||
err = pthread_create(&p, &attr, threadentry, ts);
|
||||
if (err != 0) {
|
||||
fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
static void*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue