#ifndef RUBY_THREAD_NATIVE_H /*-*-C++-*-vi:se ft=cpp:*/ #define RUBY_THREAD_NATIVE_H 1 /** * @file * @author $Author: ko1 $ * @date Wed May 14 19:37:31 2014 * @copyright Copyright (C) 2014 Yukihiro Matsumoto * @copyright This file is a part of the programming language Ruby. * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. */ /* * This file contains wrapper APIs for native thread primitives * which Ruby interpreter uses. * * Now, we only support pthread and Windows threads. * * If you want to use Ruby's Mutex and so on to synchronize Ruby Threads, * please use Mutex directly. */ #if defined(_WIN32) #include typedef HANDLE rb_nativethread_id_t; typedef union rb_thread_lock_union { HANDLE mutex; CRITICAL_SECTION crit; } rb_nativethread_lock_t; #elif defined(HAVE_PTHREAD_H) #include typedef pthread_t rb_nativethread_id_t; typedef pthread_mutex_t rb_nativethread_lock_t; #else #error "unsupported thread type" #endif RUBY_SYMBOL_EXPORT_BEGIN rb_nativethread_id_t rb_nativethread_self(); void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock); void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock); void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock); void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock); RUBY_SYMBOL_EXPORT_END #endif _0 The Ruby Programming Language
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2012-07-29* thread.c (thread_create_core): hide th->async_errinfo_mask_stack fromnagachika
2012-07-29* thread.c (Init_Thread): does not need to set klassktsj
2012-07-25* thread.c (thread_create_core, Init_Thread): hidenagachika
2012-07-22* thread.c (rb_threadptr_execute_interrupts_common): increasenaruse
2012-07-19* thread.c (rb_thread_s_control_interrupt,ko1
2012-07-19thread.c: remove deprecatednobu
2012-07-18* thread.c (rb_thread_call_without_gvl2): added.ko1
2012-07-18* thread.c: fix last commit miss.ko1
2012-07-18* thread.c (rb_threadptr_async_errinfo_*): manage async errors queue.ko1
2012-07-10rb_thread_call_without_gvlnobu
2012-07-06thread.c: unsignednobu
2012-07-06ThreadShield: check waiting countnobu
2012-07-05* thread.c: fix typo.nobu
2012-07-05ThreadShieldnobu
2012-07-04thread.c: fix rdocnobu
2012-07-02* thread.c (rb_thread_aref): add explanation for why Thread#[] andakr
2012-06-27adjust style.nobu
2012-06-11* vm_core.h: remove lfp (local frame pointer) and renameko1
2012-06-03* thread.c (vm_living_thread_num): suppress a warning.naruse
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
2012-05-17* thread.c, thread_pthread.c: Moved pthread-specific preprocessoryugui
2012-05-17Imports Ruby's port to NativeClient (a.k.a NaCl).yugui
2012-05-11Revert r35622.naruse
2012-05-11* thread.c (rb_threadptr_execute_interrupts_common): th->errinfo isnaruse
2012-04-28* vm_core.h (rb_thread_t#yielding): add a field.ko1
2012-04-26* thread.c (rb_threadptr_execute_interrupts_common):naruse
2012-04-23* thread.c (rb_check_deadlock): refine an error message of deadlockmame
2012-03-29* thread.c (rb_threadptr_execute_interrupts_common): use definedusa
2012-01-13* thread.c (rb_mutex_unlock_th): simplified.nobu
2012-01-13* thread.c (rb_barrier_waiting): fix potential overflows.nobu
2012-01-03* thread.c: changed documentation for "thread-local" variables.ayumin
2011-12-30* thread.c (rb_barrier_waiting): save the number of waiting threadsnaruse
2011-12-14* load.c (load_unlock): release loading barrier and then remove itnobu
2011-12-14* load.c (load_lock): delete the loading barrier if it has beennobu
2011-12-13* load.c (load_unlock): all threads requiring one file shouldnobu
2011-11-15* io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: useakr
2011-11-09* thread.c (do_select): fix cast, tv_sec is time_t.naruse
2011-11-03* thread.c (rb_fd_rcopy): suppress warnings on mingw32.nobu