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