Browse Source

glibc: add missing pthread_spin_{init,destroy}

h/t Sebastian Wicki for the bug report.
pull/45/head
Andrew Waterman 11 years ago
parent
commit
0390c3cf4b
  1. 10
      glibc/sysdeps/riscv/nptl/pthread_spin_destroy.c
  2. 7
      glibc/sysdeps/riscv/nptl/pthread_spin_init.c

10
glibc/sysdeps/riscv/nptl/pthread_spin_destroy.c

@ -20,11 +20,13 @@
#include "pthreadP.h"
#ifndef __riscv_atomic
int
pthread_spin_destroy (lock)
pthread_spinlock_t *lock;
pthread_spin_destroy (pthread_spinlock_t *lock)
{
#ifdef __riscv_atomic
/* Nothing to do. */
return 0;
#else
return pthread_mutex_destroy(lock);
}
#endif
}

7
glibc/sysdeps/riscv/nptl/pthread_spin_init.c

@ -21,10 +21,13 @@
#include "pthreadP.h"
#ifndef __riscv_atomic
int
pthread_spin_init (pthread_spinlock_t *lock, int pshared)
{
#ifdef __riscv_atomic
*lock = 0;
return 0;
#else
return pthread_mutex_init(lock, NULL);
}
#endif
}

Loading…
Cancel
Save