summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libpthread/pthread_once.c
blob: 16d9cb392533d4575c88bdba9b45d7fa3bbf9171 (plain)
1
2
3
4
5
6
7
8
9
#include <pthread.h>
#include "thread_internal.h"

int __pthread_once (pthread_once_t* once_control, void (*init_routine)(void))
{
  if (!(__testandset(once_control))) init_routine();
  return 0;
}
int pthread_once (pthread_once_t* once_control, void (*init_routine)(void)) __attribute__((alias("__pthread_once")));