[kazehakase-svn] [3493] Handle ruby_cleanup() behaivor when exit sequence.

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
Sun Mar 23 22:56:34 JST 2008


Revision: 3493
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3493
Author:   pal_gene
Date:     2008-03-23 22:56:34 +0900 (Sun, 23 Mar 2008)

Log Message:
-----------
Handle ruby_cleanup() behaivor when exit sequence.

this needs for scenario that recieved two more signal.
if recieved two more SIGINT(like Ctrl-C,Ctrl-C,,on console),
this bring on abort on other cleanup thread.
why ruby_cleanup() changes sigaction of SIGINT automatically.

note that i think this isn't ultimately complete solution,
but operate safely in rather case.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/ext/ruby/kz-rb-ext.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2008-03-23 13:56:31 UTC (rev 3492)
+++ kazehakase/trunk/ChangeLog	2008-03-23 13:56:34 UTC (rev 3493)
@@ -1,5 +1,18 @@
-2008-03-22  Shunichi Fuji  <palgl****@gmail*****>
+2008-03-23  Shunichi Fuji  <palgl****@gmail*****>
 
+	* ext/ruby/kz-rb-ext.c:
+	Handle ruby_cleanup() behaivor when exit sequence. 
+
+	this needs for scenario that recieved two more signal.
+	if recieved two more SIGINT(like Ctrl-C,Ctrl-C,,on console),
+	this bring on abort on other cleanup thread.
+	why ruby_cleanup() changes sigaction of SIGINT automatically.
+
+	note that i think this isn't ultimately complete solution,
+	but operate safely in rather case.
+
+2008-03-23  Shunichi Fuji  <palgl****@gmail*****>
+
 	* src/main.c:
 	- make signal handler to static.
 	- add prototype declare.

Modified: kazehakase/trunk/ext/ruby/kz-rb-ext.c
===================================================================
--- kazehakase/trunk/ext/ruby/kz-rb-ext.c	2008-03-23 13:56:31 UTC (rev 3492)
+++ kazehakase/trunk/ext/ruby/kz-rb-ext.c	2008-03-23 13:56:34 UTC (rev 3493)
@@ -226,8 +226,23 @@
 void
 kz_rb_ext_cleanup (void)
 {
+#ifndef G_OS_WIN32
+    struct sigaction act;
+#endif
+
     rb_funcall(mKz, rb_intern("exit"), 0);
+
+#ifndef G_OS_WIN32
+    /* ruby_cleanup sets SIGINT to default */
+    sigaction(SIGINT,	NULL, &act);
+#endif
+    
     ruby_cleanup(0);
+    
+#ifndef G_OS_WIN32
+    /* again set original action of SIGINT */
+    sigaction(SIGINT, &act, NULL);
+#endif
 
     g_free(_kz_rb_ext_version);
     _kz_rb_ext_version = NULL;




More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index