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

* array.c (rb_ary_and): should not push frozen key string.

* array.c (rb_ary_or): ditto.

* eval.c (rb_thread_schedule): should save context before raising
  deadlock, saved context for current thread might be obsolete.

* time.c (make_time_t): non DST timezone shift supported (hopefully).

* signal.c: SIGINFO added.

* eval.c (rb_ensure): should not SEGV when prot_tag is NULL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-05-15 08:49:23 +00:00
parent 91fdbecbda
commit be256c6f5a
7 changed files with 50 additions and 18 deletions

View file

@ -1,3 +1,24 @@
Tue May 15 17:46:37 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_and): should not push frozen key string.
* array.c (rb_ary_or): ditto.
Mon May 14 13:50:22 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_thread_schedule): should save context before raising
deadlock, saved context for current thread might be obsolete.
* time.c (make_time_t): non DST timezone shift supported (hopefully).
Mon May 14 11:54:20 2001 Tanaka Akira <akr@m17n.org>
* signal.c: SIGINFO added.
Mon May 14 08:57:06 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_ensure): should not SEGV when prot_tag is NULL.
Sun May 13 23:49:25 2001 Usaku Nakamura <usa@osb.att.ne.jp> Sun May 13 23:49:25 2001 Usaku Nakamura <usa@osb.att.ne.jp>
* win32/resource.rb: Modify copyright in resource script. * win32/resource.rb: Modify copyright in resource script.

View file

@ -1468,7 +1468,7 @@ rb_ary_and(ary1, ary2)
for (i=0; i<RARRAY(ary1)->len; i++) { for (i=0; i<RARRAY(ary1)->len; i++) {
VALUE v = RARRAY(ary1)->ptr[i]; VALUE v = RARRAY(ary1)->ptr[i];
if (st_delete(RHASH(hash)->tbl, &v, 0)) { if (st_delete(RHASH(hash)->tbl, &v, 0)) {
rb_ary_push(ary3, v); rb_ary_push(ary3, RARRAY(ary1)->ptr[i]);
} }
} }
@ -1490,13 +1490,13 @@ rb_ary_or(ary1, ary2)
for (i=0; i<RARRAY(ary1)->len; i++) { for (i=0; i<RARRAY(ary1)->len; i++) {
v = RARRAY(ary1)->ptr[i]; v = RARRAY(ary1)->ptr[i];
if (st_delete(RHASH(hash)->tbl, &v, 0)) { if (st_delete(RHASH(hash)->tbl, &v, 0)) {
rb_ary_push(ary3, v); rb_ary_push(ary3, RARRAY(ary1)->ptr[i]);
} }
} }
for (i=0; i<RARRAY(ary2)->len; i++) { for (i=0; i<RARRAY(ary2)->len; i++) {
v = RARRAY(ary2)->ptr[i]; v = RARRAY(ary2)->ptr[i];
if (st_delete(RHASH(hash)->tbl, &v, 0)) { if (st_delete(RHASH(hash)->tbl, &v, 0)) {
rb_ary_push(ary3, v); rb_ary_push(ary3, RARRAY(ary1)->ptr[i]);
} }
} }

2
dln.c
View file

@ -1204,7 +1204,7 @@ aix_loaderror(const char *pathname)
if (nerr == load_errtab[i].errno && load_errtab[i].errstr) if (nerr == load_errtab[i].errno && load_errtab[i].errstr)
ERRBUF_APPEND(load_errtab[i].errstr); ERRBUF_APPEND(load_errtab[i].errstr);
} }
while (ISDIGIT(*message[i])) message[i]++; while (isdigit(*message[i])) message[i]++;
ERRBUF_APPEND(message[i]); ERRBUF_APPEND(message[i]);
ERRBUF_APPEND("\n"); ERRBUF_APPEND("\n");
} }

5
eval.c
View file

@ -3991,9 +3991,9 @@ rb_ensure(b_proc, data1, e_proc, data2)
result = (*b_proc)(data1); result = (*b_proc)(data1);
} }
POP_TAG(); POP_TAG();
retval = prot_tag->retval; /* save retval */ retval = prot_tag ? prot_tag->retval : Qnil; /* save retval */
(*e_proc)(data2); (*e_proc)(data2);
return_value(retval); if (prot_tag) return_value(retval);
if (state) JUMP_TAG(state); if (state) JUMP_TAG(state);
return result; return result;
@ -7538,6 +7538,7 @@ rb_thread_schedule()
next->gid = 0; next->gid = 0;
rb_thread_ready(next); rb_thread_ready(next);
next->status = THREAD_TO_KILL; next->status = THREAD_TO_KILL;
rb_thread_save_context(curr_thread);
rb_thread_deadlock(); rb_thread_deadlock();
} }
next->wait_for = 0; next->wait_for = 0;

View file

@ -170,7 +170,7 @@ class Queue
Thread.critical = true Thread.critical = true
begin begin
loop do loop do
if @que.length == 0 if @que.empty?
if non_block if non_block
raise ThreadError, "queue empty" raise ThreadError, "queue empty"
end end
@ -184,13 +184,11 @@ class Queue
Thread.critical = false Thread.critical = false
end end
end end
def shift(non_block=false) alias shift pop
pop(non_block) alias deq pop
end
alias deq shift
def empty? def empty?
@que.length == 0 @que.empty?
end end
def clear def clear
@ -223,11 +221,11 @@ class SizedQueue<Queue
def max=(max) def max=(max)
Thread.critical = true Thread.critical = true
if max >= @max if max <= @max
@max = max @max = max
Thread.critical = false Thread.critical = false
else else
diff = max - @max diff = @max - max
@max = max @max = max
Thread.critical = false Thread.critical = false
diff.times do diff.times do
@ -253,6 +251,7 @@ class SizedQueue<Queue
end end
def pop(*args) def pop(*args)
retval = super
Thread.critical = true Thread.critical = true
if @que.length < @max if @que.length < @max
begin begin
@ -265,7 +264,7 @@ class SizedQueue<Queue
end end
t.run if t t.run if t
end end
super retval
end end
def num_waiting def num_waiting

View file

@ -162,6 +162,9 @@ static struct signals {
#endif #endif
#ifdef SIGSOUND #ifdef SIGSOUND
"SOUND", SIGSOUND, "SOUND", SIGSOUND,
#endif
#ifdef SIGINFO
"INFO", SIGINFO,
#endif #endif
NULL, 0, NULL, 0,
}; };

14
time.c
View file

@ -353,11 +353,19 @@ make_time_t(tptr, utc_or_local)
tm = localtime(&guess); tm = localtime(&guess);
if (!tm) goto error; if (!tm) goto error;
if (lt.tm_isdst != tm->tm_isdst || tptr->tm_hour != tm->tm_hour) { if (lt.tm_isdst != tm->tm_isdst || tptr->tm_hour != tm->tm_hour) {
oguess = guess - 3600; time_t tmp = guess - 3600;
tm = localtime(&oguess); tm = localtime(&tmp);
if (!tm) goto error; if (!tm) goto error;
if (tptr->tm_hour == tm->tm_hour) { if (tptr->tm_hour == tm->tm_hour) {
guess = oguess; guess = tmp;
}
else if (lt.tm_isdst == tm->tm_isdst) {
tmp = guess + 3600;
tm = localtime(&tmp);
if (!tm) goto error;
if (tptr->tm_hour == tm->tm_hour) {
guess = tmp;
}
} }
} }
if (guess < 0) { if (guess < 0) {