Skip to content

Commit

Permalink
Enable rb_thread_blocking_region for 1.9.0 and 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Feb 8, 2009
1 parent da502f6 commit d114062
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ext/em.cpp
Expand Up @@ -674,7 +674,7 @@ SelectData_t::_Select
int SelectData_t::_Select()
{
#ifdef HAVE_TBR
rb_thread_blocking_region (_SelectDataSelect, (void*)this, RB_UBF_DFL, 0);
rb_thread_blocking_region (_SelectDataSelect, (void*)this, RUBY_UBF_IO, 0);
return nSockets;
#endif

Expand Down Expand Up @@ -762,7 +762,7 @@ bool EventMachine_t::_RunSelectOnce()
//timeval tv = Quantum;
SelectData.tv = Quantum;
int s = SelectData._Select();
//rb_thread_blocking_region(xxx,(void*)&SelectData,RB_UBF_DFL,0);
//rb_thread_blocking_region(xxx,(void*)&SelectData,RUBY_UBF_IO,0);
//int s = EmSelect (SelectData.maxsocket+1, &(SelectData.fdreads), &(SelectData.fdwrites), NULL, &(SelectData.tv));
//int s = SelectData.nSockets;
if (s > 0) {
Expand Down
5 changes: 5 additions & 0 deletions ext/em.h
Expand Up @@ -40,6 +40,11 @@ See the file COPYING for complete licensing information.
#define TRAP_BEG
#define TRAP_END
#endif

// 1.9.0 compat
#ifndef RUBY_UDF_IO
#define RUBY_UDF_IO RB_UDF_DFL
#endif
#else
#define EmSelect select
#endif
Expand Down
2 changes: 1 addition & 1 deletion ext/extconf.rb
Expand Up @@ -34,7 +34,7 @@ def add_define(name)

add_define 'BUILD_FOR_RUBY'
add_define 'HAVE_RBTRAP' if have_var('rb_trap_immediate', ['ruby.h', 'rubysig.h'])
add_define "HAVE_TBR" if have_func('rb_thread_blocking_region') and have_macro('RB_UBF_DFL', 'ruby.h')
add_define "HAVE_TBR" if have_func('rb_thread_blocking_region')# and have_macro('RUBY_UBF_IO', 'ruby.h')

# Minor platform details between *nix and Windows:

Expand Down

0 comments on commit d114062

Please sign in to comment.