xref: /third_party/musl/src/thread/tss_set.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/src/thread/
1570af302Sopenharmony_ci#include "pthread_impl.h"
2570af302Sopenharmony_ci#include <threads.h>
3570af302Sopenharmony_ci
4570af302Sopenharmony_ciint tss_set(tss_t k, void *x)
5570af302Sopenharmony_ci{
6570af302Sopenharmony_ci	struct pthread *self = __pthread_self();
7570af302Sopenharmony_ci	/* Avoid unnecessary COW */
8570af302Sopenharmony_ci	if (self->tsd[k] != x) {
9570af302Sopenharmony_ci		self->tsd[k] = x;
10570af302Sopenharmony_ci		self->tsd_used = 1;
11570af302Sopenharmony_ci	}
12570af302Sopenharmony_ci	return thrd_success;
13570af302Sopenharmony_ci}
14

Indexes created Thu Nov 07 10:32:03 CST 2024