[#34556] /(.)(.)/.match("ab").select {|v| true } is empty — Tanaka Akira <akr@...>
以下のように、MatchData#select でブロックが常に真なのに結果
[#34567] write to broken pipe on Linux — Nobuyoshi Nakada <nobu@...>
なかだです。
まつもと ゆきひろです
なかだです。
[#34571] Re: [ruby-cvs:23495] Ruby:r16255 (ruby_1_8, trunk): * range.c (range_step): allow float step bigger than zero but less — Tanaka Akira <akr@...>
In article <200805011435.m41EZFBL003014@ci.ruby-lang.org>,
[#34605] Array#mapがEnumeratorを返さない — rubikitch@...
るびきちです。
[#34623] Marshal.load( Marshal.dump( Float ) )の不一致@1.8 — "H.Holon" <holon@...>
H.Holonです。
[#34646] break in lambda — Tanaka Akira <akr@...>
lambda 直下に break があったとき、なにごともなかったかのよう
[#34647] fork 不可能な環境での test_argv0_noarg — wanabe <s.wanabe@...>
ワナベと申します。
まつもと ゆきひろです
こんにちは、なかむら(う)です。
まつもと ゆきひろです
こんにちは、なかむら(う)です。
須藤です。
[#34648] Bignum のメソッドからの bigzero_p — wanabe <s.wanabe@...>
ワナベと申します。
[#34676] removing Array#nitems {} — "Akinori MUSHA" <knu@...>
Array#nitems はnilでない要素を数えるメソッドですが、ブロックを
[#34691] ext/openssl and newer OpenSSL — Takahiro Kambe <taca@...>
こんにちは。
[#34692] [ruby1.9] fork と thread — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
[#34726] memory leak by Array#sort! — Tanaka Akira <akr@...>
以下のように、Array#sort! の中で配列を変更するとメモりリークします。
[#34739] net/imap uses Thread#raise — Tanaka Akira <akr@...>
net/imap が原因だと思うのですが、
前田です。
In article <704d5db90805210204o7aa80c00lfeb13a34230c2c03@mail.gmail.com>,
なかだです。
[#34741] Date.parse("##-##-##") — "Akinori MUSHA" <knu@...>
Date.parse("##.##.##") の ruby_1_8 における挙動が trunk とも
> Date.parse("##.##.##") の ruby_1_8 における挙動が trunk とも
[#34742] Ruby 1.8.7-preview3 has been released — "Akinori MUSHA" <knu@...>
Ruby 1.8.7-preview3 をリリースしました。
お疲れ様です。
At Mon, 19 May 2008 11:28:10 +0900,
In message <86k5hrow30.knu@iDaemons.org>
もう一つ追加です。
At Mon, 19 May 2008 18:55:42 +0900,
[#34751] benchmark result of reverse_complement — SASADA Koichi <ko1@...>
ささだです.
[#34758] Re: [ruby-cvs:23717] Ruby:r16477 (trunk): * regparse.c (PINC): use optimized enclen() instead of — SASADA Koichi <ko1@...>
ささだです.
遠藤と申します。
[#34768] Improvement of lazy sweep patch — authorNari <authornari@...>
authorNariです。
まつもと ゆきひろです
[#34775] (1..5).step(SimpleDelegator.new(1.5)) {|x| p x} differ from (1..5).step(1.5) {|x| p x} — Tanaka Akira <akr@...>
以下のように (1..5).step(1.5) {|x| p x} と
[#34800] Windows2000上でtrunkがビルドできない — KIMURA Koichi <kimura.koichi@...>
木村です。
こんにちは、なかむら(う)です。
木村です。
木村です。
こんにちは、なかむら(う)です。
木村です。
こんにちは、なかむら(う)です。
[#34810] -Wall — SASADA Koichi <ko1@...>
ささだです.
[#34830] return value of pp — "Yusuke ENDOH" <mame@...>
遠藤です。
[#34877] [Ruby 1.9 - Bug #11] prelude.c compilation problem on mswin32 — redmine@...
Issue #11 has been updated by Usaku NAKAMURA.
[#34883] [#19002] RUBY_* constants — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#34889] Ruby 1.8.7-preview4 test-all failed in OpenSSL::TestSSL — Nobuhiro IMAI <nov@...>
いまいです。
Nobuhiro IMAI さんは書きました:
At Sat, 31 May 2008 21:06:47 +0900,
この話題についていろいろ試していて気付いたのですが
[ruby-dev:34885] Re: Invalid read may occur when raising an exception to a thread that waits for mutex
なかだです。
At Wed, 28 May 2008 21:42:48 +0900,
Yusuke ENDOH wrote in [ruby-dev:34874]:
> unblock_function がクリアされないのは set_unblock_function 内で
> RUBY_VM_CHECK_INTS をしていて、そこから longjmp するせいです。
> この RUBY_VM_CHECK_INTS は必要なんでしょうか。
BLOCKING_REGIONに入るときにはcheckしても問題ないんじゃないでしょ
うか。問題が起きるのは抜けるときですよね。
Index: vm_core.h
===================================================================
--- vm_core.h (revision 16676)
+++ vm_core.h (working copy)
@@ -374,4 +374,9 @@ struct rb_vm_trap_tag {
#define USE_VALUE_CACHE 0
+struct rb_unblock_callback {
+ rb_unblock_function_t *func;
+ void *arg;
+};
+
typedef struct rb_thread_struct rb_thread_t;
@@ -419,7 +424,6 @@ struct rb_thread_struct
int interrupt_flag;
- rb_unblock_function_t *unblock_function;
- void *unblock_function_arg;
rb_thread_lock_t interrupt_lock;
+ struct rb_unblock_callback unblock;
struct rb_vm_tag *tag;
Index: thread.c
===================================================================
--- thread.c (revision 16676)
+++ thread.c (working copy)
@@ -80,6 +80,7 @@ st_delete_wrap(st_table *table, st_data_
#define THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
-static void set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, void *ptr,
- rb_unblock_function_t **oldfunc, void **oldptr);
+static void set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, void *arg,
+ struct rb_unblock_callback *old);
+static void reset_unblock_function(rb_thread_t *th, const struct rb_unblock_callback *old);
#define GVL_UNLOCK_BEGIN() do { \
@@ -96,7 +97,6 @@ static void set_unblock_function(rb_thre
rb_thread_t *__th = GET_THREAD(); \
int __prev_status = __th->status; \
- rb_unblock_function_t *__oldubf; \
- void *__oldubfarg; \
- set_unblock_function(__th, ubf, ubfarg, &__oldubf, &__oldubfarg); \
+ struct rb_unblock_callback __oldubf; \
+ set_unblock_function(__th, ubf, ubfarg, &__oldubf); \
__th->status = THREAD_STOPPED; \
thread_debug("enter blocking region (%p)\n", __th); \
@@ -107,5 +107,5 @@ static void set_unblock_function(rb_thre
thread_debug("leave blocking region (%p)\n", __th); \
remove_signal_thread_list(__th); \
- set_unblock_function(__th, __oldubf, __oldubfarg, 0, 0); \
+ reset_unblock_function(__th, &__oldubf); \
if (__th->status == THREAD_STOPPED) { \
__th->status = __prev_status; \
@@ -196,5 +196,5 @@ rb_thread_debug(const char *fmt, ...)
static void
set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, void *arg,
- rb_unblock_function_t **oldfunc, void **oldarg)
+ struct rb_unblock_callback *old)
{
check_ints:
@@ -206,8 +206,7 @@ set_unblock_function(rb_thread_t *th, rb
}
else {
- if (oldfunc) *oldfunc = th->unblock_function;
- if (oldarg) *oldarg = th->unblock_function_arg;
- th->unblock_function = func;
- th->unblock_function_arg = arg;
+ if (old) *old = th->unblock;
+ th->unblock.func = func;
+ th->unblock.arg = arg;
}
native_mutex_unlock(&th->interrupt_lock);
@@ -215,10 +214,18 @@ set_unblock_function(rb_thread_t *th, rb
static void
+reset_unblock_function(rb_thread_t *th, const struct rb_unblock_callback *old)
+{
+ native_mutex_lock(&th->interrupt_lock);
+ th->unblock = *old;
+ native_mutex_unlock(&th->interrupt_lock);
+}
+
+static void
rb_thread_interrupt(rb_thread_t *th)
{
native_mutex_lock(&th->interrupt_lock);
RUBY_VM_SET_INTERRUPT(th);
- if (th->unblock_function) {
- (th->unblock_function)(th->unblock_function_arg);
+ if (th->unblock.func) {
+ (th->unblock.func)(th->unblock.arg);
}
else {
Index: thread_pthread.c
===================================================================
--- thread_pthread.c (revision 16676)
+++ thread_pthread.c (working copy)
@@ -425,6 +425,6 @@ native_sleep(rb_thread_t *th, struct tim
{
pthread_mutex_lock(&th->interrupt_lock);
- th->unblock_function = ubf_pthread_cond_signal;
- th->unblock_function_arg = th;
+ th->unblock.func = ubf_pthread_cond_signal;
+ th->unblock.arg = th;
if (RUBY_VM_INTERRUPTED(th)) {
@@ -452,6 +452,6 @@ native_sleep(rb_thread_t *th, struct tim
}
}
- th->unblock_function = 0;
- th->unblock_function_arg = 0;
+ th->unblock.func = 0;
+ th->unblock.arg = 0;
pthread_mutex_unlock(&th->interrupt_lock);
Index: thread_win32.c
===================================================================
--- thread_win32.c (revision 16676)
+++ thread_win32.c (working copy)
@@ -221,6 +221,6 @@ native_sleep(rb_thread_t *th, struct tim
th->status = THREAD_STOPPED;
- th->unblock_function = ubf_handle;
- th->unblock_function_arg = th;
+ th->unblock.func = ubf_handle;
+ th->unblock.arg = th;
if (RUBY_VM_INTERRUPTED(th)) {
@@ -233,6 +233,6 @@ native_sleep(rb_thread_t *th, struct tim
}
- th->unblock_function = 0;
- th->unblock_function_arg = 0;
+ th->unblock.func = 0;
+ th->unblock.arg = 0;
th->status = status;
}
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦