Revision ec6afcac750699146edd1c93456bcfca11bb07c5 authored by Kristoffer Carlsson on 27 December 2017, 19:20:08 UTC, committed by Fredrik Ekre on 27 December 2017, 19:20:08 UTC
1 parent e5c68f3
tls.h
// This file is a part of Julia. License is MIT: https://julialang.org/license
#ifndef JL_TLS_H
#define JL_TLS_H
// Thread-local storage access
// Copied from libuv. Add `JL_CONST_FUNC` so that the compiler
// can optimize this better.
static inline unsigned long JL_CONST_FUNC jl_thread_self(void)
{
#ifdef _OS_WINDOWS_
return (unsigned long)GetCurrentThreadId();
#else
return (unsigned long)pthread_self();
#endif
}
typedef struct _jl_tls_states_t jl_tls_states_t;
typedef jl_tls_states_t *jl_ptls_t;
#ifdef __cplusplus
extern "C" {
#endif
JL_DLLEXPORT int16_t jl_threadid(void);
JL_DLLEXPORT void jl_threading_profile(void);
JL_DLLEXPORT JL_CONST_FUNC jl_ptls_t (jl_get_ptls_states)(void);
#ifndef JULIA_ENABLE_THREADING
extern JL_DLLEXPORT jl_tls_states_t jl_tls_states;
#define jl_get_ptls_states() (&jl_tls_states)
#else // ifndef JULIA_ENABLE_THREADING
typedef jl_ptls_t (*jl_get_ptls_states_func)(void);
#if !defined(_OS_DARWIN_) && !defined(_OS_WINDOWS_)
JL_DLLEXPORT void jl_set_ptls_states_getter(jl_get_ptls_states_func f);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...