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.
9 // #include <pthread.h>
10 // extern void setTLS(int);
11 // extern int getTLS();
19 func testTLS(t *testing.T) {
20 runtime.LockOSThread()
21 defer runtime.UnlockOSThread()
23 if val := C.getTLS(); val != 0 {
24 t.Fatalf("at start, C.getTLS() = %#x, want 0", val)
29 if val := C.getTLS(); val != keyVal {
30 t.Fatalf("at end, C.getTLS() = %#x, want %#x", val, keyVal)