github.com/varialus/godfly@v0.0.0-20130904042352-1934f9f095ab/misc/cgo/testtls/tls_unix.c (about) 1 // Copyright 2013 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 #include <pthread.h> 6 7 static __thread int tls; 8 9 void 10 setTLS(int v) 11 { 12 tls = v; 13 } 14 15 int 16 getTLS() 17 { 18 return tls; 19 }