Sha256: b0fc95e170ecd549f1cf4faca3e80bbb5738513aa1a20f38644d72b990952b88

Contents?: true

Size: 698 Bytes

Versions: 8

Compression:

Stored size: 698 Bytes

Contents

#include "pycall_internal.h"

#if defined(PYCALL_THREAD_WIN32)
int pycall_tls_create(pycall_tls_key *tls_key)
{
  *tls_key = TlsAlloc();
  return *tls_key == TLS_OUT_OF_INDEXES;
}

void *pycall_tls_get(pycall_tls_key tls_key)
{
  return TlsGetValue(tls_key);
}

int pycall_tls_set(pycall_tls_key tls_key, void *ptr)
{
  return 0 == TlsSetValue(tls_key, ptr);
}
#endif

#if defined(PYCALL_THREAD_PTHREAD)
int pycall_tls_create(pycall_tls_key *tls_key)
{
  return pthread_key_create(tls_key, NULL);
}

void *pycall_tls_get(pycall_tls_key tls_key)
{
  return pthread_getspecific(tls_key);
}

int pycall_tls_set(pycall_tls_key tls_key, void *ptr)
{
  return pthread_setspecific(tls_key, ptr);
}
#endif

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pycall-1.5.1 ext/pycall/thread.c
pycall-1.5.0 ext/pycall/thread.c
pycall-1.4.2 ext/pycall/thread.c
pycall-1.4.1 ext/pycall/thread.c
pycall-1.4.0 ext/pycall/thread.c
pycall-1.3.1 ext/pycall/thread.c
pycall-1.3.0 ext/pycall/thread.c
pycall-1.3.0.dev ext/pycall/thread.c