Skip to content

Commit c86982a

Browse files
committed
Move rb_nativethread_lock_* functions to ruby.c
1 parent 1a8900d commit c86982a

File tree

3 files changed

+20
-24
lines changed

3 files changed

+20
-24
lines changed

lib/cext/include/ruby/thread_native.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ RUBY_SYMBOL_EXPORT_BEGIN
4747

4848
rb_nativethread_id_t rb_nativethread_self();
4949

50-
MUST_INLINE int rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock);
51-
MUST_INLINE int rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
52-
MUST_INLINE int rb_nativethread_lock_lock(rb_nativethread_lock_t *lock);
53-
MUST_INLINE int rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock);
50+
void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock);
51+
void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
52+
void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock);
53+
void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock);
5454

5555
RUBY_SYMBOL_EXPORT_END
5656

lib/cext/include/truffleruby/truffleruby.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -164,26 +164,6 @@ VALUE rb_ivar_lookup(VALUE object, const char *name, VALUE default_value);
164164

165165
// Inline implementations
166166

167-
MUST_INLINE int rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock) {
168-
*lock = RUBY_CEXT_INVOKE("rb_nativethread_lock_initialize");
169-
return 0;
170-
}
171-
172-
MUST_INLINE int rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock) {
173-
*lock = RUBY_CEXT_INVOKE("rb_nativethread_lock_destroy", *lock);
174-
return 0;
175-
}
176-
177-
MUST_INLINE int rb_nativethread_lock_lock(rb_nativethread_lock_t *lock) {
178-
RUBY_INVOKE_NO_WRAP(*lock, "lock");
179-
return 0;
180-
}
181-
182-
MUST_INLINE int rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock) {
183-
RUBY_INVOKE_NO_WRAP(*lock, "unlock");
184-
return 0;
185-
}
186-
187167
MUST_INLINE int rb_tr_scan_args(int argc, VALUE *argv, const char *format, VALUE *v1, VALUE *v2, VALUE *v3, VALUE *v4, VALUE *v5, VALUE *v6, VALUE *v7, VALUE *v8, VALUE *v9, VALUE *v10) {
188168
// Parse the format string
189169

src/main/c/cext/ruby.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,22 @@ rb_nativethread_id_t rb_nativethread_self() {
26532653
return RUBY_CEXT_INVOKE("rb_nativethread_self");
26542654
}
26552655

2656+
void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock) {
2657+
*lock = RUBY_CEXT_INVOKE("rb_nativethread_lock_initialize");
2658+
}
2659+
2660+
void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock) {
2661+
*lock = RUBY_CEXT_INVOKE("rb_nativethread_lock_destroy", *lock);
2662+
}
2663+
2664+
void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock) {
2665+
RUBY_INVOKE_NO_WRAP(*lock, "lock");
2666+
}
2667+
2668+
void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock) {
2669+
RUBY_INVOKE_NO_WRAP(*lock, "unlock");
2670+
}
2671+
26562672
// IO
26572673

26582674
void rb_io_check_writable(rb_io_t *io) {

0 commit comments

Comments
 (0)