1#ifndef RUBY_THREAD_PTHREAD_H
2#define RUBY_THREAD_PTHREAD_H
16#ifdef HAVE_PTHREAD_NP_H
17#include <pthread_np.h>
20#define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
21#define RB_NATIVETHREAD_COND_INIT PTHREAD_COND_INITIALIZER
23#include "thread_sched.h"
25#ifdef RB_THREAD_LOCAL_SPECIFIER
34 #define RUBY_NT_SERIAL 1
36typedef pthread_key_t native_tls_key_t;
39native_tls_get(native_tls_key_t key)
42 return pthread_getspecific(key);
46native_tls_set(native_tls_key_t key,
void *ptr)
48 if (UNLIKELY(pthread_setspecific(key, ptr) != 0)) {
49 rb_bug(
"pthread_setspecific error");
std::atomic< unsigned > rb_atomic_t
Type that is eligible for atomic operations.
#define RUBY_EXTERN
Declaration of externally visible global variables.