MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / _pthread_cleanup_dest

Function _pthread_cleanup_dest

include/hamlib/winpthreads.h:374–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372
373
374static void _pthread_cleanup_dest(pthread_t t)
375{
376 unsigned i, j;
377
378 for (j = 0; j < PTHREAD_DESTRUCTOR_ITERATIONS; j++)
379 {
380 int flag = 0;
381
382 for (i = 0; i < t->keymax; i++)
383 {
384 void *val = t->keyval[i];
385
386 if (val)
387 {
388 pthread_rwlock_rdlock(&_pthread_key_lock);
389 if ((uintptr_t) _pthread_key_dest[i] > 1)
390 {
391 /* Call destructor */
392 t->keyval[i] = NULL;
393 _pthread_key_dest[i](val);
394 flag = 1;
395 }
396 pthread_rwlock_unlock(&_pthread_key_lock);
397 }
398 }
399
400 /* Nothing to do? */
401 if (!flag) return;
402 }
403}
404
405static pthread_t pthread_self(void)
406{

Callers 2

pthread_exitFunction · 0.85
pthread_create_wrapperFunction · 0.85

Calls 2

pthread_rwlock_rdlockFunction · 0.85
pthread_rwlock_unlockFunction · 0.85

Tested by

no test coverage detected