aboutsummaryrefslogtreecommitdiffstats
path: root/ext/thread
Commit message (Collapse)AuthorAgeFilesLines
* handle ext/ as r53141naruse2015-12-161-0/+1
| | | | | | | | g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&# frozen_string_literal: false\n");f.rewind;f.write s}}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c: move definitions of Queue, SizedQueueko12015-08-211-652/+0
| | | | | | | | | | | | | | | | | | | | | and ConditionalVariables to thread_tools.c. In other wowrds, such classes are built-in. [Feature #8919] At first, I planned to embed only a Queue class. However, rubygems requires 'thread.rb' (rubygems are required at first, when launch MRI without --disable-gems). So most of people require 'thread.rb' as an embedded library. Now, ext/thread/thread.c is empty, only for a dummy for compatibility. * thread.c: move a definition of Mutex class to thread_tools.c. And define Mutex class under Thread (so now Mutex is Thread::Mutex). Because other thread related classes are also defined under Thread. We remain ::Mutex as Thread::Mutex. Only an inspect result is changed. * common.mk: add dependency from thread.o to thraed_tools.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: refine enumsnobu2015-02-271-5/+7
| | | | | | | * ext/thread/thread.c: remove unnecessary enum values and add end of enumerations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: no function callsin RARRAY_LENnobu2014-11-071-3/+6
| | | | | | | | | | * ext/thread/thread.c (queue_length, queue_num_waiting): avoid function calls in RARRAY_LEN macro which evaluates the argument multiple times. * ext/thread/thread.c (rb_szqueue_num_waiting): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: check initializednobu2014-08-191-4/+14
| | | | | | | * ext/thread/thread.c (get_array): check instance variables are initialized properly. [ruby-core:63826][Bug #10062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c: added nodoc attribute intohsbt2014-07-191-0/+1
| | | | | | | 'ConditionVariable#marshal_dump' by @vipulnsward [fix GH-672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread/thread.c: simplifynobu2014-07-171-34/+21
| | | | | | | | | * ext/thread/thread.c (queue_pop_should_block): returns int instead of VALUE, and use rb_check_arity. * ext/thread/thread.c (szqueue_push_should_block): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread/thread.c: non-blocking push on SizedQueuenobu2014-07-171-6/+31
| | | | | | | * ext/thread/thread.c (rb_szqueue_push): add optional parameter, non_block defaulted to false. [ruby-core:63794] [Feature #10052] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: undumpablenobu2014-03-261-0/+9
| | | | | | | * ext/thread/thread.c (undumpable): ConditionVariable and Queue are not dumpable. [ruby-core:61677] [Bug #9674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/thread: SizedQueue#max= wakes up waiters properlynormal2014-02-051-1/+1
| | | | | | | | | * ext/thread/thread.c (rb_szqueue_max_set): use correct queue and limit wakeups. [Bug #9343][ruby-core:60517] * test/thread/test_queue.rb (test_sized_queue_assign_max): test for bug git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread/thread.c: no dupnobu2014-01-221-0/+2
| | | | | | | * ext/thread/thread.c (Init_thread): ConditionVariable and Queue are not able to copy. [ruby-core:59961] [Bug #9440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c (rb_szqueue_clear): notify SZQUEUE_WAITERSglass2014-01-141-0/+15
| | | | | | | | | on SizedQueue#clear. [ruby-core:59462] [Bug #9342] * test/thread/test_queue.rb: add test. the patch is from Justin Collins. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERScharliesome2014-01-131-1/+1
| | | | | | | | | instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong. [Bug #9302] [ruby-core:59324] * test/thread/test_queue.rb: add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c: [DOC] add call-seq alias for Queue#enq, #<<, etc.ktsj2013-12-091-13/+38
| | | | | | | * ext/thread/thread.c (Init_thread): use rb_define_alias instead of rb_alias to document alias. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c: [DOC] This patch accomplishes the following:zzak2013-11-131-59/+63
| | | | | | | | | | | | | - Teach RDoc about ConditionVariable - Teach RDoc about Queue - Teach RDoc about SizedQueue - Use fully-qualified namespace for Document-method This is necessary to separate definitions between classes - Fix rdoc bug in call_seq vs. call-seq - Correct doc for SizedQueue#pop patch by @jackdanger [Bug #8988] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c (ALIAS_GLOBAL_CONST): fix typo, GLOBCAL.nobu2013-10-021-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/thread/thread.c (Init_thread): move outer module condition.nobu2013-10-021-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: invertnobu2013-09-071-1/+1
| | | | | | | * ext/thread/thread.c (queue_pop_should_block): the first argument of Queue#pop is non_block and inverted for should_block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: function castnobu2013-09-071-1/+8
| | | | | | | * ext/thread/thread.c (queue_sleep): get rid of casting function pointer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk: use RUNRUBY instead of MINIRUBY because MINIRUBY can'tglass2013-09-062-0/+569
require extension libraries. The patch is from nobu (Nobuyoshi Nakada). * ext/thread/extconf.rb: for build ext/thread/thread.c. * include/ruby/intern.h: ditto. * thread.c: ditto. * lib/thread.rb: removed and replaced by ext/thread/thread.c. * ext/thread/thread.c: Queue, SizedQueue and ConditionVariable implementations in C. This patch is based on patches from panaggio (Ricardo Panaggio) and funny_falcon (Yura Sokolov) and ko1 (Koichi Sasada). [ruby-core:31513] [Feature #3620] * test/thread/test_queue.rb (test_queue_thread_raise): add a test for ensuring that killed thread should be removed from waiting threads. It is based on a code by ko1 (Koichi Sasada). [ruby-core:45950] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e