• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "pthread_impl.h"
2 #include "pthread_ffrt.h"
3 
pthread_setspecific(pthread_key_t k,const void * x)4 int pthread_setspecific(pthread_key_t k, const void *x)
5 {
6 	struct pthread *self = __pthread_self();
7 	/* Avoid unnecessary COW */
8 	if (self->tsd[k] != x) {
9 		self->tsd[k] = (void *)x;
10 		self->tsd_used = 1;
11 	}
12 	return 0;
13 }
14 
pthread_settsd(void ** tsd)15 void pthread_settsd(void** tsd)
16 {
17 	struct pthread *self = __pthread_self();
18 	self->tsd = tsd;
19 }