tls_unix.c 272 B

12345678910111213141516171819
  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. #include <pthread.h>
  5. static __thread int tls;
  6. void
  7. setTLS(int v)
  8. {
  9. tls = v;
  10. }
  11. int
  12. getTLS()
  13. {
  14. return tls;
  15. }