summaryrefslogtreecommitdiff
path: root/thread_pthread.c
AgeCommit message (Collapse)Author
2018-04-23thread_pthread.c: fallback to CLOCK_REALTIMEnobu
* thread_pthread.c (Init_native_thread): fallback to the default CLOCK_REALTIME when failed to set to CLOCK_MONOTONIC, e.g. on Solaris. [Misc #14497] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22thread*: all condvars are monotonicnormal
There's no reason to use CLOCK_REALTIME for any condvars in Ruby. Indeed, we initialized all condvars with RB_CONDATTR_CLOCK_MONOTONIC anyway; so simplify our code and reduce ifdefs. [ruby-core:85639] [Misc #14497] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20simplify altstack and enable reuse with thread cachenormal
Instead of allocating and registering the altstack in different places, do it together to reduce code and improve readability. When thread cache is enabled, storing altstack in rb_thread_t is wasteful and we may reuse altstack in the same pthread. This also lets us clearly allow use of xmalloc to allow GC to recover from ENOMEM. [ruby-core:85621] [Feature #14487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-05Tiny Fix for ASYNC BUG error message copyingnobu
The previous logic would overwrite the error message, replacing the message with the `fd` number. This tiny update will print the message in full. (I'm trying to debug an issue with the timer thread on my machine and the lack of error messages makes it really hard). [Fix GH-1829] From: Bo <bo@bowild.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-19thread_pthread.c: spelling ("cancellation")normal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-19thread_pthread.c: fix thread cache for non-monotonic clocknormal
I noticed this because of https://bugs.ruby-lang.org/issues/14494 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-19thread_pthread.c (native_thread_create): remove needless attrpnormal
Followup-to: r61719 (commit e8f40bd8f83e1b22ef9c22f0e5d7a1fc0b07f94c) ("thread_pthread: remove HAVE_PTHREAD_ATTR_INIT ifdefs") [ruby-core:84758] [Misc #14342] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-19thread_pthread.c (rb_thread_create_mjit_thread): destroy attrnormal
This is required on some platforms to avoid leaks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-18thread_pthread.c (thread cache): destroy cond after unlocknormal
No need to hold a lock while destroying a condition variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-18thread_pthread.c (rb_thread_create_mjit): set detach before createnormal
This should be slightly cheaper on NPTL as it does not rely on atomics to set pd->joinid. We already use pthread_attr_setdetachstate, so it won't introduce new problems by using a function we did not use before. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-18adjust indentnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-18thread_pthread.c: shorten and fix thread cache implementationnormal
Update to use ccan/list for constant-time delete on expiry and avoid malloc. We must also initialize th->thread_id upon thread reuse so Thread#name= works immediately upon thread creation. We must also reinitialize the cache mutex and list_head on fork like we do with GVL and timer thread mutexes. While we're at it, use monotonic clock for timeout to avoid system time changes. "make exam TESTS='-x test_time_tz'" passes with USE_THREAD_CACHE enabled (but remains off, here). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-18thread_pthread.c (native_cond_timeout): simplifynormal
Rely on getclockofday for CLOCK_MONOTONIC, avoid needless variables, and rely on overflow protection from timespec_add instead of coding our own. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15thread_pthread.c: Use `getpagesize()` when `pthread_attr_getguardsize` is ↵mame
unavailable This is also for emscripten. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-07fix up r62272nobu
* thread.c (timeval_for): tv_usec is suseconds_t which may be smaller than long. * thread_pthread.c (native_cond_timeout): ret is now used in CLOCK_MONOTONIC case only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-07thread.c: favor timespec internallynormal
This results in fewer conversion on common modern systems with support for clock_gettime, pthread_cond_timedwait and ppoll. gettimeofday is declared obsolete by POSIX.1-2008, so it is yet another reason to move away from it. This also appears to result in the reduction of compatibility code required for dealing with inconsistent implementations of "struct timeval".tv_sec In the future, this will also result in fewer conversions for kqueue and pselect if we elect to use them. [ruby-core:85416] [Feature #14452] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-06thread_pthread.c: cast inside rb_thread_create_mjit_threadnobu
* thread_pthread.c (rb_thread_create_mjit_thread): cast worker_func pointer to void pointer inside. adjusted to the declaration in mjit.c and the definition in thread_win32.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-05assigning void* to a function pointer is a POSIXismshyouhei
No implicit cast is defined between these types. Should be explicit. Also, NULL is defined to be ((void*)0) so not usable as a function pointer value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-04mjit.c: merge MJIT infrastructurek0kubun
that allows to JIT-compile Ruby methods by generating C code and using C compiler. See the first comment of mjit.c to know what this file does. mjit.c is authored by Vladimir Makarov <vmakarov@redhat.com>. After he invented great method JIT infrastructure for MRI as MJIT, Lars Kanis <lars@greiz-reinsdorf.de> sent the patch to support MinGW in MJIT. In addition to merging it, I ported pthread to Windows native threads. Now this MJIT infrastructure can be compiled on Visual Studio. This commit simplifies mjit.c to decrease code at initial merge. For example, this commit does not provide multiple JIT threads support. We can resurrect them later if we really want them, but I wanted to minimize diff to make it easier to review this patch. `/tmp/_mjitXXX` file is renamed to `/tmp/_ruby_mjitXXX` because non-Ruby developers may not know the name "mjit" and the file name should make sure it's from Ruby and not from some harmful programs. TODO: it may be better to store this to some temporary directory which Ruby is already using by Tempfile, if it's not bad for performance. mjit.h: New. It has `mjit_exec` interface similar to `vm_exec`, which is for triggering MJIT. This drops interface for AOT compared to the original MJIT. Makefile.in: define macros to let MJIT know the path of MJIT header. Probably we can refactor this to reduce the number of macros (TODO). win32/Makefile.sub: ditto. common.mk: compile mjit.o and mjit_compile.o. Unlike original MJIT, this commit separates MJIT infrastructure and JIT compiler code as independent object files. As initial patch is NOT going to have ultra-fast JIT compiler, it's likely to replace JIT compiler, e.g. original MJIT's compiler or some future JIT impelementations which are not public now. inits.c: define MJIT module. This is added because `MJIT.enabled?` was necessary for testing. test/lib/zombie_hunter.rb: skip if `MJIT.enabled?`. Obviously this wouldn't work with current code when JIT is enabled. test/ruby/test_io.rb: skip this too. This would make no sense with MJIT. ruby.c: define MJIT CLI options. As major difference from original MJIT, "-j:l"/"--jit:llvm" are renamed to "--jit-cc" because I want to support not only gcc/clang but also cl.exe (Visual Studio) in the future. But it takes only "--jit-cc=gcc", "--jit-cc=clang" for now. And only long "--jit" options are allowed since some Ruby committers preferred it at Ruby developers Meeting on January, and some of options are renamed. This file also triggers to initialize MJIT thread and variables. eval.c: finalize MJIT worker thread and variables. test/ruby/test_rubyoptions.rb: fix number of CLI options for --jit. thread_pthread.c: change for pthread abstraction in MJIT. Prefix rb_ for functions which are used by other files. thread_win32.c: ditto, for Windows. Those pthread porting is one of major works that YARV-MJIT created, which is my fork of MJIT, in Feature 14235. thread.c: follow rb_ prefix changes vm.c: trigger MJIT call on VM invocation. Also trigger `mjit_mark` to avoid SEGV by race between JIT and GC of ISeq. The improvement was provided by wanabe <s.wanabe@gmail.com>. In JIT compiler I created and am going to add in my next commit, I found that having `mjit_exec` after `vm_loop_start:` is harmful because the JIT-ed function doesn't proceed other ISeqs on RESTORE_REGS of leave insn. Executing non-FINISH frame is unexpected for my JIT compiler and `exception_handler` triggers executions of such ISeqs. So `mjit_exec` here should be executed only when it directly comes from `vm_exec` call. `RubyVM::MJIT` module and `.enabled?` method is added so that we can skip some tests which don't expect JIT threads or compiler file descriptors. vm_insnhelper.h: trigger MJIT on method calls during VM execution. vm_core.h: add fields required for mjit.c. `bp` must be `cfp[6]` because rb_control_frame_struct is likely to be casted to another struct. The last position is the safest place to add the new field. vm_insnhelper.c: save initial value of cfp->ep as cfp->bp. This is an optimization which are done in both MJIT and YARV-MJIT. So this change is added in this commit. Calculating bp from ep is a little heavy work, so bp is kind of cache for it. iseq.c: notify ISeq GC to MJIT. We should know which iseq in MJIT queue is GCed to avoid SEGV. TODO: unload some GCed units in some safe way. gc.c: add hooks so that MJIT can wait GC, and vice versa. Simultaneous JIT and GC executions may cause SEGV and so we should synchronize them. cont.c: save continuation information in MJIT worker. As MJIT shouldn't unload JIT-ed code which is being used, MJIT wants to know full list of saved execution contexts for continuation and detect ISeqs in use. mjit_compile.c: added empty JIT compiler so that you can reuse this commit to build your own JIT compiler. This commit tries to compile ISeqs but all of them are considered as not supported in this commit. So you can't use JIT compiler in this commit yet while we added --jit option now. Patch author: Vladimir Makarov <vmakarov@redhat.com>. Contributors: Takashi Kokubun <takashikkbn@gmail.com>. wanabe <s.wanabe@gmail.com>. Lars Kanis <lars@greiz-reinsdorf.de>. Part of Feature 12589 and 14235. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09thread_pthread.c: remove dead code around "get_stack_of"normal
"get_stack_of" was only in a proposed patch for [Feature #8793] https://bugs.ruby-lang.org/issues/8793 and never applied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09thread_pthread.c: round stack sizenobu
* thread_pthread.c (rb_thread_create_timer_thread): round up additional stack size to PTHREAD_STACK_MIN, to get rid of EINVAL at pthread_attr_setstacksize(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09thread_pthread: remove checks for pthread_cond*_initnormal
These were added for NaCL support in r36022, and we dropped NaCL in r60374. IMHO, any pthreads implementation without these basic functions is not worth the time to support. [ruby-core:84758] [Misc #14342] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09thread_pthread: remove HAVE_PTHREAD_ATTR_INIT ifdefsnormal
ifdefs make code confusing for my easily-confused mind :< These were added for NaCL support in r36022, and we dropped NaCL in r60374. There are more #ifdefs to remove... [ruby-core:84758] [Misc #14342] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09Fix the position of VM_ASSERT for "pthread_create failed for time"mame
Fix r61706. Thank you, Eric Wong. [ruby-core:84756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09thread_pthread: more diagnostics around timer thread creation failuresnormal
However, I don't think EAGAIN on pthread_create can really be fixed in our code. I suspect test machines are overloaded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09Explicit failure in VM_CHECK_MODE when failing to create timer threadmame
"warning: pthread_create failed for timer: Resource temporarily unavailable, scheduling broken" still occurs randomly. This change will allow us to debug the issue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02thread_pthread.c: use container_ofnormal
It's easier to read this macro from ccan than open-coding pointer arithmetic. thread_pthread.c (ubf_wakeup_all_threads): use container_of git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02offsetof(type, foo.bar) is (arguably) a GCCismshyouhei
TL;DR see http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2031.htm Suppose we have: struct X { struct Y { z_t z; } y; } x; then, you _cant_ infer offsetof(struct X, y.z). The ISO C99 section 7.17 says nothing about such situation. At least clang warns this being an extension to the language (-Wextended-offsetof). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-06move rb_thread_t::interrupt_flag and maskko1
to rb_execution_context_t. * vm_core.h (rb_thread_t): move `rb_thread_t::interrupt_flag` and `rb_thread_t::interrupt_mask` to rb_execution_context_t. RUBY_VM_CHECK_INTS() accepts `ec` instead of `th`. * cont.c (rb_fiber_terminate): to propagate interrupt information, add new parameter `need_interrupt`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26Use rb_execution_context_t instead of rb_thread_tko1
to represent execution context [Feature #14038] * vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer. There are many code using `th` to represent execution context (such as cfp, VM stack and so on). To access `ec`, they need to use `th->ec->...` (adding one indirection) so that we need to replace them by passing `ec` instead of `th`. * vm_core.h (GET_EC()): introduced to access current ec. Also remove `ruby_current_thread` global variable. * cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of rb_context_t::thread_value. * cont.c (ec_set_vm_stack): added to update vm_stack explicitly. * cont.c (ec_switch): added to switch ec explicitly. * cont.c (rb_fiber_close): added to terminate fibers explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23thread_pthread: do not corrupt stacknormal
This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on GNU/Linux because linked-list pointers used by glibc get corrupted when fiber stacks are copied. Thanks to wanabe for finding the bug and original patch. * thread_pthread (native_thread_init_stack): fix stack corruption [ruby-core:82737] [Bug #13387] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23Drop to support NaCl platform.hsbt
Because NaCl and PNaCl are already sunset status. see https://bugs.chromium.org/p/chromium/issues/detail?id=239656#c160 configure.ac: Patch for this file was provided by @nobu. [Feature #14041][ruby-core:83497][fix GH-1726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30thread_pthread.c: do not wakeup inside child processesnormal
* thread_pthread.c (rb_thread_wakeup_timer_thread): check ownership before incrementing (rb_thread_wakeup_timer_thread_low): ditto [Bug #13794] [ruby-core:83064] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-10move th->machine to ec->machine.ko1
* vm_core.h: move rb_thread_t::machine to rb_execution_context_t::machine. * vm_core.h, gc.c (rb_gc_mark_machine_stack): accept ec instead of th. it enables to call this func from rb_execution_context_mark() in vm.c. * cont.c (fiber_setcontext): catch up this fix. fiber_restore_thread() restores machine stack information too. * gc.c: catch up structure layout changes. * thread.c: ditto. * thread_pthread.c: ditto. * thread_win32.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-26thread_win32.c: set thread namenobu
* thread_win32.c (native_set_another_thread_name): set thread name by SetThreadDescription. * win32/win32.c (rb_w32_set_thread_description): dynamically try SetThreadDescription. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-10a64: fix crash on register stack mark/sweep passtakano32
* thread_pthread.c: move 'register_stack_start' earlier. [ruby-core:79928] [Bug #13284] [Fix GH-1625] Author: Sergei Trofimovich <slyfox@gentoo.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-09thread_pthread.c: workaround for valgrind on Macnobu
* thread.c: revert r59053. * thread_pthread.c (rb_thread_create_timer_thread): needs more stack space for valgrind. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24thread_pthread: retry timer thread creation w/o attr on EINVALnormal
Setting a small stack size can fail due to having 3rd-party libraries (e.g. libkqueue) loaded, if those libraries use thread-local-storage (__thread) heavily. This causes pthread_create to fail with small stacks; even if our timer_thread function does not hit any of the TLS-using code paths. Today, some RubyGems are capable of using libkqueue (or __thread storage directly), and future versions of Ruby may use kqueue internally. cf. https://www.akkadia.org/drepper/tls.pdf git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-26[DOC] replace Fixnum with Integer [ci skip]nobu
* numeric.c: [DOC] update document for Integer class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-03thread_pthread.c: check stack on co-routine casenobu
* thread_pthread.c (ruby_init_stack): check stack bounds even if get_main_stack succeeded, on the "co-routine" case. https://github.com/ruby/ruby/commit/53953ee#commitcomment-18887413 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-20thread_pthread.c: no fork, no gvl_atforknobu
* thread_pthread.c (gvl_atfork): used in rb_thread_atfork_internal only if HAVE_WORKING_FORK is defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15thread.c: defer setting name in initializenobu
* thread.c (rb_thread_setname): defer setting native thread name set in initialize until the native thread is created. [ruby-core:74963] [Bug #12290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-24* thread_pthread.c (reserve_stack): fix reserving position wherenaruse
the stack growing bottom to top. [Bug #12118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-04* thread_pthread.c (getstack): __pi_stacksize returned byodaira
pthread_getthrds_np() is wrong on AIX. Use __pi_stackend - __pi_stackaddr instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-29* thread_pthread.c (rb_thread_create_timer_thread): destroy attr evennagachika
if pthread_create() failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-29thread_pthread.c (rb_thread_create_timer_thread): fix racenormal
This fixes an occasional [ASYNC BUG] failure in bootstraptest/test_fork.rb '[ruby-dev:37934]' which tests fork/pthread_create failure by setting RLIMIT_NPROC to 1 and triggering EAGAIN on pthread_create when attempting to recreate the timer thread. The problem timeline is as follows: thread 1 thread 2 --------------------------------------------------------------- rb_thread_create_timer_thread setup_communication_pipe rb_thread_wakeup_timer_thread_low pthread_create fails pipe looks valid, write! CLOSE_INVALIDATE (x4) EBADF -> ASYNC BUG The checks in rb_thread_wakeup_timer_thread_low only tried to guarantee proper ordering with native_stop_timer_thread, not rb_thread_create_timer_thread :x Now, this should allow rb_thread_create_timer_thread to synchronize properly with rb_thread_wakeup_timer_thread_low by delaying the validation marking of the timer_thread_pipe until we are certain the timer thread is alive. In this version, rb_thread_wakeup_timer_thread_low becomes a noop. Threading is still completely broken with NPROC==1, but there's not much we can do about it beside warn the user. We no longer spew a scary [ASYNC BUG] message or dump core on them. * thread_pthread.c (setup_communication_pipe): delay setting owner (rb_thread_create_timer_thread): until thread creation succeeds [ruby-core:72590] [Bug #11922] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14* compile.c: fix typos.hsbt
[ci skip][fix GH-1140] Patch by @jutaz * dir.c: ditto. * gc.c: ditto. * io.c: ditto. * node.h: ditto. * thread_pthread.c: ditto. * vm_insnhelper.c: ditto. * vsnprintf.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-03configure.in: split SET_THREAD_NAMEnobu
* configure.in: separate SET_CURRENT_THREAD_NAME, which can set the name of current thread only, and SET_ANOTHER_THREAD_NAME, which can set the name of other threads. * thread.c (rb_thread_setname): use SET_ANOTHER_THREAD_NAME. OS X is not possible to set another thread name. * thread_pthread.c (native_set_thread_name, thread_timer): use SET_CURRENT_THREAD_NAME. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30* thread_pthread.c (register_ubf_list): renamed fromkosaki
add_signal_thread_list. * thread_pthread.c (unregister_ubf_list): renamed from remove_signal_thread_list. * thread_pthread.c (ubf_wakeup_all_threads): renamed from ping_signal_thread_list. * thread_pthread.c (ubf_wakeup_thread): renamed from ubf_select_each. * thread_pthread.c (ubf_threads_empty): renamed from check_signal_thread_list(). * thread_pthread.c (ubf_list_lock): renamed from signal_thread_list_lock. * thread_pthread.c (register_ubf_list): large simplification by using ccan/list.h. bonus: removed malloc() and exit(EXIT_FAILURE). * thread_pthread.c (unregister_ubf_list): ditto. * thread_pthread.c (ubf_threads_empty): ditto. * thread_pthread.c (ubf_wakeup_all_threads): ditto. * thread_pthread.c (print_signal_list): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23Haiku now best effort supportnobu
* configure.in: remove obsolete workarounds for Haiku. * dln.c, file.c, io.c: remove obsolete Haiku workarounds. * thread_pthread.c: add stack bounds detection for Haiku. * signal.c: get stack pointer from signal context on Haiku. [ruby-core:67923] [Bug #10811] [Fix GH-1109] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e