1 #ifndef RUBY_THREAD_WIN32_H
2 #define RUBY_THREAD_WIN32_H
3 /**********************************************************************
9 Copyright (C) 2004-2007 Koichi Sasada
11 **********************************************************************/
19 #define USE_VM_CLOCK 1
21 WINBASEAPI BOOL WINAPI
22 TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection
);
24 struct rb_native_thread
{
26 HANDLE interrupt_event
;
29 struct rb_thread_sched_item
{
33 struct rb_thread_sched
{
37 typedef DWORD native_tls_key_t
; // TLS index
40 native_tls_get(native_tls_key_t key
)
42 // return value should be checked by caller.
43 return TlsGetValue(key
);
47 native_tls_set(native_tls_key_t key
, void *ptr
)
49 if (UNLIKELY(TlsSetValue(key
, ptr
) == 0)) {
50 rb_bug("TlsSetValue() error");
54 RUBY_SYMBOL_EXPORT_BEGIN
55 RUBY_EXTERN native_tls_key_t ruby_current_ec_key
;
56 RUBY_SYMBOL_EXPORT_END
58 #endif /* RUBY_THREAD_WIN32_H */