* process.c (rb_fork): stops the timer thread during fork.
[ruby-dev:37117] * thread.c (rb_thread_start_timer_thread): timer thread needs system_working to be set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
361a713f96
commit
4d6d0a933e
@ -1,3 +1,11 @@
|
|||||||
|
Tue Nov 25 00:08:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* process.c (rb_fork): stops the timer thread during fork.
|
||||||
|
[ruby-dev:37117]
|
||||||
|
|
||||||
|
* thread.c (rb_thread_start_timer_thread): timer thread needs
|
||||||
|
system_working to be set.
|
||||||
|
|
||||||
Mon Nov 24 23:27:28 2008 Shugo Maeda <shugo@ruby-lang.org>
|
Mon Nov 24 23:27:28 2008 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* strftime.c (rb_strftime): The # flag should work with %a, %A, %b,
|
* strftime.c (rb_strftime): The # flag should work with %a, %A, %b,
|
||||||
|
10
process.c
10
process.c
@ -975,6 +975,8 @@ void rb_thread_reset_timer_thread(void);
|
|||||||
(rb_enable_interrupt(), rb_thread_stop_timer_thread())
|
(rb_enable_interrupt(), rb_thread_stop_timer_thread())
|
||||||
#define after_exec() \
|
#define after_exec() \
|
||||||
(rb_thread_start_timer_thread(), rb_disable_interrupt())
|
(rb_thread_start_timer_thread(), rb_disable_interrupt())
|
||||||
|
#define before_fork() before_exec()
|
||||||
|
#define after_fork() after_exec()
|
||||||
|
|
||||||
#include "dln.h"
|
#include "dln.h"
|
||||||
|
|
||||||
@ -2272,7 +2274,8 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg, VALUE fds)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
for (; (pid = fork()) < 0; prefork()) {
|
for (; before_fork(), (pid = fork()) < 0; prefork()) {
|
||||||
|
after_fork();
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case EAGAIN:
|
case EAGAIN:
|
||||||
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
|
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
|
||||||
@ -2298,7 +2301,6 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg, VALUE fds)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
rb_thread_reset_timer_thread();
|
|
||||||
if (chfunc) {
|
if (chfunc) {
|
||||||
#ifdef FD_CLOEXEC
|
#ifdef FD_CLOEXEC
|
||||||
close(ep[0]);
|
close(ep[0]);
|
||||||
@ -2314,10 +2316,10 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg, VALUE fds)
|
|||||||
_exit(127);
|
_exit(127);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
rb_thread_start_timer_thread();
|
|
||||||
}
|
}
|
||||||
|
after_fork();
|
||||||
#ifdef FD_CLOEXEC
|
#ifdef FD_CLOEXEC
|
||||||
else if (chfunc) {
|
if (pid && chfunc) {
|
||||||
close(ep[1]);
|
close(ep[1]);
|
||||||
if ((state = read(ep[0], &err, sizeof(err))) < 0) {
|
if ((state = read(ep[0], &err, sizeof(err))) < 0) {
|
||||||
err = errno;
|
err = errno;
|
||||||
|
1
thread.c
1
thread.c
@ -2371,6 +2371,7 @@ rb_thread_reset_timer_thread(void)
|
|||||||
void
|
void
|
||||||
rb_thread_start_timer_thread(void)
|
rb_thread_start_timer_thread(void)
|
||||||
{
|
{
|
||||||
|
system_working = 1;
|
||||||
rb_thread_create_timer_thread();
|
rb_thread_create_timer_thread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#define RUBY_VERSION "1.9.0"
|
#define RUBY_VERSION "1.9.0"
|
||||||
#define RUBY_RELEASE_DATE "2008-11-24"
|
#define RUBY_RELEASE_DATE "2008-11-25"
|
||||||
#define RUBY_VERSION_CODE 190
|
#define RUBY_VERSION_CODE 190
|
||||||
#define RUBY_RELEASE_CODE 20081124
|
#define RUBY_RELEASE_CODE 20081125
|
||||||
#define RUBY_PATCHLEVEL 0
|
#define RUBY_PATCHLEVEL 0
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
@ -9,7 +9,7 @@
|
|||||||
#define RUBY_VERSION_TEENY 0
|
#define RUBY_VERSION_TEENY 0
|
||||||
#define RUBY_RELEASE_YEAR 2008
|
#define RUBY_RELEASE_YEAR 2008
|
||||||
#define RUBY_RELEASE_MONTH 11
|
#define RUBY_RELEASE_MONTH 11
|
||||||
#define RUBY_RELEASE_DAY 24
|
#define RUBY_RELEASE_DAY 25
|
||||||
|
|
||||||
#ifdef RUBY_EXTERN
|
#ifdef RUBY_EXTERN
|
||||||
RUBY_EXTERN const char ruby_version[];
|
RUBY_EXTERN const char ruby_version[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user