1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

19 commits

Author SHA1 Message Date
shyouhei
fffffd6df2 merge revision(s) 22011:
* ext/thread/thread.c (rb_queue_pop, rb_queue_push): should not lock
	  mutex if got an exception while waiting, and should ensure unlocked
	  after signaled.  [ruby-dev:37545]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@23047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23 10:16:30 +00:00
shyouhei
14579de431 merge revision(s) 17874,17886:
* eval.c (rb_thread_join): new API.
	* ext/thread/thread.c (wait_mutex, lock_mutex): wait until the locking
	  thread exits.  [ruby-dev:34856]
	* eval.c (rb_thread_value): missed to change at r17874.  [ruby-core:17595]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@23042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23 09:26:03 +00:00
shyouhei
50b224dd15 * eval.c, intern.h, ext/thread/thread.c: should not free queue while
any live threads are waiting.  [ruby-dev:30653]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-23 00:01:50 +00:00
shyouhei
d9a45b677e * ext/thread/thread.c (lock_mutex): should take care of threads
not waiting any longer; there cases of a thread raising
	  exceptions. [ ruby-Bugs-11901 ]

	* test/thread/test_thread.rb (test_mutex_exception_handling):
	  test for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-16 20:42:15 +00:00
nobu
428209ed74 * intern.h, ext/thread/thread.c: moved prototype of rb_thread_status()
to get rid of error in C++.  [ruby-list:43615]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-18 02:28:11 +00:00
shyouhei
887e1011c3 * eval.c, intern.h, ext/thread/thread.c: should not free queue
while any live threads are waiting.
  [ruby-dev:30653]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-07 12:40:01 +00:00
shyouhei
9ff0555a1e merge -c 12113
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-22 12:02:38 +00:00
shyouhei
e27ef85f5c * merge -r 12066:12069
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-16 11:31:00 +00:00
knu
7c35689239 * ext/thread/thread.c (push_list): Use ALLOC().
* ext/thread/thread.c (rb_mutex_alloc): Ditto.

* ext/thread/thread.c (rb_condvar_alloc): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@11970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-03 10:08:06 +00:00
knu
9369118f8f Merge changes between r11871 and r11907 from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@11908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-27 11:51:55 +00:00
knu
c31e487592 * ext/thread/thread.c: Handle interrupted waits correctly.
[ruby-bugs:PR#8663]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-15 01:57:03 +00:00
knu
02db1bdf77 * configure.in, ext/thread/extconf.rb, lib/thread.rb: Add a
configure option `--disable-fastthread', to choose the original,
  pure ruby version of the "thread" library instead of the new,
  much faster implementation in ext/thread.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-10 21:41:26 +00:00
knu
e8b3e1af53 * ext/thread/lib/thread.rb: Add a replacement of thread.rb that
loads this extension.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-10 21:18:24 +00:00
knu
2a7ec27be2 * ext/thread/thread.c (rb_thread_exclusive): Implement
Thread.exclusive.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-10 20:33:50 +00:00
knu
f9c378051a * ext/thread/thread.c: Get rid of use of a dummy function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-10 20:27:58 +00:00
knu
e366c36b6b * ext/thread/thread.c (Init_thread): Define missing aliases:
Queue#enq and SizedQueue#enq.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-10 16:48:02 +00:00
knu
b28988b4f1 * ext/thread: Make style fixes (mostly de-K&R'ism) to match the
rest of the source code.

* ext/thread: Make USE_MEM_POOLS an extconf option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-09 11:48:34 +00:00
knu
fff0db9dfe Oops, this is the original form. I committed the wrong file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-09 11:44:11 +00:00
knu
60047f3822 * ext/thread: Import the "fastthread" implementation by MenTaLguY
in the original form.  This module is not hooked into the build
  yet since it needs some style fixes and adjustments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-09 11:41:49 +00:00