mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* signal.c (sighandler): need to tell to be interrupted to main
context when handler is installed. * win32/win32.[ch] (rb_win32_interrupted): new function to listen interrupt. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
38c8efbe2d
commit
ae2370fb50
4 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Fri Feb 23 14:19:40 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* signal.c (sighandler): need to tell to be interrupted to main
|
||||||
|
context when handler is installed.
|
||||||
|
|
||||||
|
* win32/win32.[ch] (rb_win32_interrupted): new function to listen
|
||||||
|
interrupt.
|
||||||
|
|
||||||
Fri Feb 23 13:02:17 2007 Akinori MUSHA <knu@iDaemons.org>
|
Fri Feb 23 13:02:17 2007 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* numeric.c (fix_cmp, fix_equal): Remove FIX2LONG() to optimize.
|
* numeric.c (fix_cmp, fix_equal): Remove FIX2LONG() to optimize.
|
||||||
|
|
3
signal.c
3
signal.c
|
@ -493,6 +493,9 @@ sighandler(sig)
|
||||||
else {
|
else {
|
||||||
ATOMIC_INC(rb_trap_pending);
|
ATOMIC_INC(rb_trap_pending);
|
||||||
ATOMIC_INC(trap_pending_list[sig]);
|
ATOMIC_INC(trap_pending_list[sig]);
|
||||||
|
#ifdef _WIN32
|
||||||
|
rb_w32_interrupted();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3323,6 +3323,12 @@ setup_call(CONTEXT* ctx, struct handler_arg_t *harg)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rb_w32_interrupted(void)
|
||||||
|
{
|
||||||
|
SetSignal(interrupted_event);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_w32_main_context(int arg, void (*handler)(int))
|
rb_w32_main_context(int arg, void (*handler)(int))
|
||||||
{
|
{
|
||||||
|
@ -3334,7 +3340,7 @@ rb_w32_main_context(int arg, void (*handler)(int))
|
||||||
|
|
||||||
if (GetCurrentThreadId() == main_thread.id) return FALSE;
|
if (GetCurrentThreadId() == main_thread.id) return FALSE;
|
||||||
|
|
||||||
SetSignal(interrupted_event);
|
rb_w32_interrupted();
|
||||||
|
|
||||||
RUBY_CRITICAL({ /* the main thread must be in user state */
|
RUBY_CRITICAL({ /* the main thread must be in user state */
|
||||||
CONTEXT ctx;
|
CONTEXT ctx;
|
||||||
|
|
|
@ -531,6 +531,7 @@ int rb_w32_times(struct tms *);
|
||||||
|
|
||||||
/* thread stuff */
|
/* thread stuff */
|
||||||
HANDLE GetCurrentThreadHandle(void);
|
HANDLE GetCurrentThreadHandle(void);
|
||||||
|
void rb_w32_interrupted(void);
|
||||||
int rb_w32_main_context(int arg, void (*handler)(int));
|
int rb_w32_main_context(int arg, void (*handler)(int));
|
||||||
int rb_w32_sleep(unsigned long msec);
|
int rb_w32_sleep(unsigned long msec);
|
||||||
void rb_w32_enter_critical(void);
|
void rb_w32_enter_critical(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue