Skip to content
This repository
Browse code

Enable rb_thread_blocking_region for 1.9.0 and 1.9.1

  • Loading branch information...
commit d114062a22b932d3b2f3859cded36efab4aee108 1 parent da502f6
Aman Gupta authored February 08, 2009
4  ext/em.cpp
@@ -674,7 +674,7 @@ SelectData_t::_Select
674 674
 int SelectData_t::_Select()
675 675
 {
676 676
 	#ifdef HAVE_TBR
677  
-	rb_thread_blocking_region (_SelectDataSelect, (void*)this, RB_UBF_DFL, 0);
  677
+	rb_thread_blocking_region (_SelectDataSelect, (void*)this, RUBY_UBF_IO, 0);
678 678
 	return nSockets;
679 679
 	#endif
680 680
 
@@ -762,7 +762,7 @@ bool EventMachine_t::_RunSelectOnce()
762 762
 		//timeval tv = Quantum;
763 763
 		SelectData.tv = Quantum;
764 764
 		int s = SelectData._Select();
765  
-		//rb_thread_blocking_region(xxx,(void*)&SelectData,RB_UBF_DFL,0);
  765
+		//rb_thread_blocking_region(xxx,(void*)&SelectData,RUBY_UBF_IO,0);
766 766
 		//int s = EmSelect (SelectData.maxsocket+1, &(SelectData.fdreads), &(SelectData.fdwrites), NULL, &(SelectData.tv));
767 767
 		//int s = SelectData.nSockets;
768 768
 		if (s > 0) {
5  ext/em.h
@@ -40,6 +40,11 @@ See the file COPYING for complete licensing information.
40 40
     #define TRAP_BEG
41 41
     #define TRAP_END
42 42
   #endif
  43
+
  44
+  // 1.9.0 compat
  45
+  #ifndef RUBY_UDF_IO
  46
+    #define RUBY_UDF_IO RB_UDF_DFL
  47
+  #endif
43 48
 #else
44 49
   #define EmSelect select
45 50
 #endif
2  ext/extconf.rb
@@ -34,7 +34,7 @@ def add_define(name)
34 34
 
35 35
 add_define 'BUILD_FOR_RUBY'
36 36
 add_define 'HAVE_RBTRAP' if have_var('rb_trap_immediate', ['ruby.h', 'rubysig.h'])
37  
-add_define "HAVE_TBR" if have_func('rb_thread_blocking_region') and have_macro('RB_UBF_DFL', 'ruby.h')
  37
+add_define "HAVE_TBR" if have_func('rb_thread_blocking_region')# and have_macro('RUBY_UBF_IO', 'ruby.h')
38 38
 
39 39
 # Minor platform details between *nix and Windows:
40 40
 

0 notes on commit d114062

Please sign in to comment.
Something went wrong with that request. Please try again.