ruby-changes:7466
From: ko1 <ko1@a...>
Date: Sun, 31 Aug 2008 16:47:10 +0900 (JST)
Subject: [ruby-changes:7466] Ruby:r18985 (trunk): * include/ruby/intern.h: rename RB_UBF_DFL to
ko1 2008-08-31 16:44:24 +0900 (Sun, 31 Aug 2008) New Revision: 18985 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18985 Log: * include/ruby/intern.h: rename RB_UBF_DFL to RUBY_UBF_IO and RUBY_UBF_PROCESS. Because there is no default (universal) unblocking function. * ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto. Modified files: trunk/ChangeLog trunk/ext/socket/socket.c trunk/file.c trunk/include/ruby/intern.h trunk/io.c trunk/process.c trunk/thread.c Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 18984) +++ include/ruby/intern.h (revision 18985) @@ -661,7 +661,8 @@ void rb_thread_check_ints(void); VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1, rb_unblock_function_t *ubf, void *data2); -#define RB_UBF_DFL ((rb_unblock_function_t *)-1) +#define RUBY_UBF_IO ((rb_unblock_function_t *)-1) +#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1) VALUE rb_mutex_new(void); VALUE rb_mutex_locked_p(VALUE mutex); VALUE rb_mutex_try_lock(VALUE mutex); Index: ChangeLog =================================================================== --- ChangeLog (revision 18984) +++ ChangeLog (revision 18985) @@ -1,3 +1,11 @@ +Sun Aug 31 16:43:56 2008 Koichi Sasada <ko1@a...> + + * include/ruby/intern.h: rename RB_UBF_DFL to + RUBY_UBF_IO and RUBY_UBF_PROCESS. + Because there is no default (universal) unblocking function. + + * ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto. + Sun Aug 31 16:42:23 2008 Tanaka Akira <akr@f...> * transcode.c (econv_insert_output): raise ArgumentError on failure. Index: io.c =================================================================== --- io.c (revision 18984) +++ io.c (revision 18985) @@ -524,7 +524,7 @@ iis.buf = buf; iis.capa = count; - return rb_thread_blocking_region(internal_read_func, &iis, RB_UBF_DFL, 0); + return rb_thread_blocking_region(internal_read_func, &iis, RUBY_UBF_IO, 0); } static int @@ -535,7 +535,7 @@ iis.buf = buf; iis.capa = count; - return rb_thread_blocking_region(internal_write_func, &iis, RB_UBF_DFL, 0); + return rb_thread_blocking_region(internal_write_func, &iis, RUBY_UBF_IO, 0); } static int @@ -3925,7 +3925,7 @@ data.fname = fname; data.flag = flags; data.mode = mode; - return (int)rb_thread_blocking_region(sysopen_func, &data, RB_UBF_DFL, 0); + return (int)rb_thread_blocking_region(sysopen_func, &data, RUBY_UBF_IO, 0); } static int @@ -7372,7 +7372,7 @@ rb_fd_set(src_fd, &stp->fds); rb_fd_set(dst_fd, &stp->fds); - return rb_thread_blocking_region(copy_stream_func, (void*)stp, RB_UBF_DFL, 0); + return rb_thread_blocking_region(copy_stream_func, (void*)stp, RUBY_UBF_IO, 0); } static VALUE Index: thread.c =================================================================== --- thread.c (revision 18984) +++ thread.c (revision 18985) @@ -931,8 +931,8 @@ VALUE val; rb_thread_t *th = GET_THREAD(); - if (ubf == RB_UBF_DFL) { - ubf = ubf_select; + if (ubf == RUBY_UBF_IO || ubf == RUBY_UBF_PROCESS) { + ubf = ubf_select;n data2 = th; } Index: process.c =================================================================== --- process.c (revision 18984) +++ process.c (revision 18985) @@ -633,7 +633,7 @@ arg.st = st; arg.flags = flags; result = (rb_pid_t)rb_thread_blocking_region(rb_waitpid_blocking, &arg, - RB_UBF_DFL, 0); + RUBY_UBF_PROCESS, 0); if (result < 0) { #if 0 if (errno == EINTR) { @@ -656,7 +656,7 @@ for (;;) { result = (rb_pid_t)rb_thread_blocking_region(rb_waitpid_blocking, - st, RB_UBF_DFL); + st, RUBY_UBF_PROCESS); if (result < 0) { if (errno == EINTR) { rb_thread_schedule(); Index: ext/socket/socket.c =================================================================== --- ext/socket/socket.c (revision 18984) +++ ext/socket/socket.c (revision 18985) @@ -102,7 +102,7 @@ #endif #endif -#define BLOCKING_REGION(func, arg) (long)rb_thread_blocking_region((func), (arg), RB_UBF_DFL, 0) +#define BLOCKING_REGION(func, arg) (long)rb_thread_blocking_region((func), (arg), RUBY_UBF_IO, 0) #define INET_CLIENT 0 #define INET_SERVER 1 Index: file.c =================================================================== --- file.c (revision 18984) +++ file.c (revision 18985) @@ -3472,7 +3472,7 @@ if (fptr->mode & FMODE_WRITABLE) { rb_io_flush(obj); } - while ((int)rb_thread_blocking_region(rb_thread_flock, op, RB_UBF_DFL, 0) < 0) { + while ((int)rb_thread_blocking_region(rb_thread_flock, op, RUBY_UBF_IO, 0) < 0) { switch (errno) { case EAGAIN: case EACCES: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/