macos: symbols for rb_execution_context_t
should be internal
This commit is contained in:
parent
f052aa11f2
commit
3c4d788bfe
Notes:
git
2023-07-08 02:31:36 +00:00
@ -310,11 +310,11 @@ static inline void
|
|||||||
rb_ractor_set_current_ec_(rb_ractor_t *cr, rb_execution_context_t *ec, const char *file, int line)
|
rb_ractor_set_current_ec_(rb_ractor_t *cr, rb_execution_context_t *ec, const char *file, int line)
|
||||||
{
|
{
|
||||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||||
#ifdef __APPLE__
|
# ifdef __APPLE__
|
||||||
rb_current_ec_set(ec);
|
rb_current_ec_set(ec);
|
||||||
#else
|
# else
|
||||||
ruby_current_ec = ec;
|
ruby_current_ec = ec;
|
||||||
#endif
|
# endif
|
||||||
#else
|
#else
|
||||||
native_tls_set(ruby_current_ec_key, ec);
|
native_tls_set(ruby_current_ec_key, ec);
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,19 +90,18 @@ struct rb_thread_sched {
|
|||||||
int wait_yield;
|
int wait_yield;
|
||||||
};
|
};
|
||||||
|
|
||||||
RUBY_SYMBOL_EXPORT_BEGIN
|
|
||||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||||
# ifdef __APPLE__
|
# ifdef __APPLE__
|
||||||
// on Darwin, TLS can not be accessed across .so
|
// on Darwin, TLS can not be accessed across .so
|
||||||
struct rb_execution_context_struct *rb_current_ec(void);
|
struct rb_execution_context_struct *rb_current_ec(void);
|
||||||
void rb_current_ec_set(struct rb_execution_context_struct *);
|
void rb_current_ec_set(struct rb_execution_context_struct *);
|
||||||
# else
|
# else
|
||||||
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;
|
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;
|
||||||
|
|
||||||
// for RUBY_DEBUG_LOG()
|
// for RUBY_DEBUG_LOG()
|
||||||
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER rb_atomic_t ruby_nt_serial;
|
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER rb_atomic_t ruby_nt_serial;
|
||||||
#define RUBY_NT_SERIAL 1
|
#define RUBY_NT_SERIAL 1
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
typedef pthread_key_t native_tls_key_t;
|
typedef pthread_key_t native_tls_key_t;
|
||||||
|
|
||||||
@ -123,6 +122,5 @@ native_tls_set(native_tls_key_t key, void *ptr)
|
|||||||
|
|
||||||
RUBY_EXTERN native_tls_key_t ruby_current_ec_key;
|
RUBY_EXTERN native_tls_key_t ruby_current_ec_key;
|
||||||
#endif
|
#endif
|
||||||
RUBY_SYMBOL_EXPORT_END
|
|
||||||
|
|
||||||
#endif /* RUBY_THREAD_PTHREAD_H */
|
#endif /* RUBY_THREAD_PTHREAD_H */
|
||||||
|
21
vm.c
21
vm.c
@ -446,16 +446,17 @@ RB_THREAD_LOCAL_SPECIFIER rb_atomic_t ruby_nt_serial;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
rb_execution_context_t *
|
rb_execution_context_t *
|
||||||
rb_current_ec(void)
|
rb_current_ec(void)
|
||||||
{
|
{
|
||||||
return ruby_current_ec;
|
return ruby_current_ec;
|
||||||
}
|
}
|
||||||
void
|
|
||||||
rb_current_ec_set(rb_execution_context_t *ec)
|
void
|
||||||
{
|
rb_current_ec_set(rb_execution_context_t *ec)
|
||||||
ruby_current_ec = ec;
|
{
|
||||||
}
|
ruby_current_ec = ec;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user