diff --git a/ChangeLog b/ChangeLog index 30fdd5cbd4..429b5d6b63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 19 12:46:15 2010 Nobuyoshi Nakada + + * lib/timeout.rb (Timeout#timeout): propagate errors to the + caller. [ruby-dev:41010]' + Sat Apr 17 09:04:24 2010 Nobuyoshi Nakada * configure.in (--with-{ruby-version,{site,vendor}dir}): use diff --git a/lib/timeout.rb b/lib/timeout.rb index 5a99c28092..e60b4e3f13 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -56,8 +56,13 @@ module Timeout begin x = Thread.current y = Thread.start { - sleep sec - x.raise exception, "execution expired" if x.alive? + begin + sleep sec + rescue => e + x.raise e + else + x.raise exception, "execution expired" if x.alive? + end } yield sec # return true @@ -73,7 +78,10 @@ module Timeout # would be expected outside. raise Error, e.message, e.backtrace ensure - y.kill if y and y.alive? + if y and y.alive? + y.kill + y.join # make sure y is dead. + end end end diff --git a/version.h b/version.h index 61f4777812..f936a92bb7 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.8.8" -#define RUBY_RELEASE_DATE "2010-04-17" +#define RUBY_RELEASE_DATE "2010-04-19" #define RUBY_VERSION_CODE 188 -#define RUBY_RELEASE_CODE 20100417 +#define RUBY_RELEASE_CODE 20100419 #define RUBY_PATCHLEVEL -1 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 8 #define RUBY_RELEASE_YEAR 2010 #define RUBY_RELEASE_MONTH 4 -#define RUBY_RELEASE_DAY 17 +#define RUBY_RELEASE_DAY 19 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];