tss_create.c 368 B

1234567891011
  1. #include <threads.h>
  2. int __pthread_key_create(tss_t *, void (*)(void *));
  3. int tss_create(tss_t *tss, tss_dtor_t dtor)
  4. {
  5. /* Different error returns are possible. C glues them together into
  6. * just failure notification. Can't be optimized to a tail call,
  7. * unless thrd_error equals EAGAIN. */
  8. return __pthread_key_create(tss, dtor) ? thrd_error : thrd_success;
  9. }