runtime/cgo: make code robust
According to http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_key_create.html, pthread_key_create return an error number which is greater than or equal to 0. I don't know the scenario that pthread_setspecific would fail, but also don't know the future. Add some error handlings just in case. Change-Id: I0774b79ef658d67e300f4a9aab1f2e3879acc7ee Reviewed-on: https://go-review.googlesource.com/54811Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Showing
Please register or sign in to comment