summaryrefslogtreecommitdiff
path: root/include/ruby/thread_native.h
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <ktsanaktsidis@zendesk.com>2023-05-26 12:02:30 +1000
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-26 14:51:23 +0900
commit54a74c42033e42869e69e7dc9e67efa1faf225be (patch)
tree709fec3c20fad2a7d644ca9a6fb03dc49972b155 /include/ruby/thread_native.h
parent8c4da473dec7f733254aad4816857536e85f93f3 (diff)
Move rb_thread_cond_struct definition into thread_native.h
On Win32, currently, rb_nativethread_cond_t is an incomplete type because it's a typedef for `struct rb_thread_cond_struct`. That means you can't actually allocate a rb_nativethread_cond_t unless you also include THREAD_IMPL_H (since its defined in thread_win32.h) (alternatively, including vm_core.h also works). Move the definition of rb_thread_cond_struct into thread_native.h to alleviate this.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7865
Diffstat (limited to 'include/ruby/thread_native.h')
-rw-r--r--include/ruby/thread_native.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ruby/thread_native.h b/include/ruby/thread_native.h
index c23b15e133..8217a67514 100644
--- a/include/ruby/thread_native.h
+++ b/include/ruby/thread_native.h
@@ -28,6 +28,11 @@ typedef union rb_thread_lock_union {
CRITICAL_SECTION crit;
} rb_nativethread_lock_t;
+struct rb_thread_cond_struct {
+ struct cond_event_entry *next;
+ struct cond_event_entry *prev;
+};
+
typedef struct rb_thread_cond_struct rb_nativethread_cond_t;
#elif defined(HAVE_PTHREAD_H)