Ian Lance Taylor | 30e29ee | 2013-03-27 13:27:35 -0700 | [diff] [blame] | 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 | } |