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

24 commits

Author SHA1 Message Date
nobu
8d018b2248 * intern.h (rb_thread_join): added prototype. a patch from
Mikhail T. in [ruby-core:26217].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22 08:27:24 +00:00
nobu
b45d7f9341 * ext/thread/thread.c (unlock_mutex_inner): fixed wrong variable.
a patch from Jeremy Kemper <jeremy AT bitsweat.net> at
  [ruby-core:23592].  [ruby-core:23588]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-29 00:19:57 +00:00
nobu
8dfd918d5b * ext/thread/thread.c (unlock_mutex_inner): should adjust join
target here but not in wake_one.  a patch from John Carter at
  [ruby-core:23490].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-18 12:13:22 +00:00
nobu
072ccff04d * eval.c (rb_thread_join), ext/thread/thread.c (wake_one): adjusts
targets of rest waiting threads to join.  [ruby-core:23457]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-15 08:33:52 +00:00
nobu
45108851f0 * 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@22011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 09:35:50 +00:00
nobu
cdd1d98ef2 * eval.c (rb_thread_join): new API.
* ext/thread/thread.c (wait_mutex, lock_mutex): wait until the locking
  thread exits.  [ruby-dev:34856]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-04 11:31:35 +00:00
nobu
02da16b167 * 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@13476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-20 18:05:40 +00:00
nobu
39e50d214d * ext/thread/thread.c (wait_list): supress a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-14 04:26:57 +00:00
knu
1bb22ded25 * ext/thread/thread.c (remove_one): Preserve List invariants;
submitted by: MenTaLguY <mental AT rydia.net>
  in [ruby-core:10598] and [ruby-bugs:PR#9388].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-20 22:26:18 +00:00
knu
5f4b6b984a * ext/thread/thread.c (unlock_mutex_inner): Make sure that the
given mutex is actually owned by the caller; submitted by:
  Sylvain Joyeux <sylvain.joyeux AT m4x.org> in [ruby-core:10598].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-16 07:36:08 +00:00
knu
15b97d196a * ext/thread/thread.c (wait_condvar, lock_mutex): Fix a problem in
ConditionVariable#wait that occurs when two threads that are
  trying to access the condition variable are also in concurrence
  for the given mutex; submitted by: Sylvain Joyeux
  <sylvain.joyeux AT m4x.org> and MenTaLguY <mental AT rydia.net>
  in [ruby-core:10598].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-16 07:27:09 +00:00
knu
e6e0e815ab * 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@11969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-03 10:06:33 +00:00
knu
e9ebc1c8db * ext/thread/thread.c (wait_list_cleanup, rb_mutex_try_lock):
Eliminate rb_thread_critical switching where unnecessary;
  implied by shugo in [ruby-dev:30412].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-26 19:03:21 +00:00
knu
5386d05fb2 Oops, apply some more hunks to complete the previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-26 18:53:44 +00:00
knu
25f8c4c391 * ext/thread/thread.c (set_critical): Merge in
thread_exclusive_ensure().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-26 18:50:51 +00:00
knu
3bcf72a28c * ext/thread/thread.c: Consistently use 0 and 1 for
rb_thread_critical values.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-26 18:41:08 +00:00
knu
e529cb40d0 * ext/thread/thread.c: Use xmalloc()/xfree() instead of
malloc()/free(); pointed out by shugo in [ruby-dev:30412].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-26 06:22:08 +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
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