| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
[Bug #5130] [ruby-core:38647]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
* io.c (rb_cloexec_pipe): new function.
(rb_pipe): use rb_cloexec_pipe.
* thread_pthread.c (rb_thread_create_timer_thread): use
rb_cloexec_pipe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* io.c (rb_fd_set_cloexec): new function.
(ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
(rb_sysopen_internal): ditto.
(rb_pipe): ditto.
(io_reopen): ditto.
(io_cntl): ditto.
* process.c (rb_f_exec): change the default :close_others option to
true.
(rb_f_system): ditto.
(move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
close-on-exec flag.
(ruby_setsid): ditto.
(rb_daemon): ditto.
* thread_pthread.c (rb_thread_create_timer_thread): call
rb_fd_set_cloexec to set close-on-exec flag.
* ruby.c (load_file_internal): ditto.
* file.c (rb_file_s_truncate): ditto.
(file_load_ok): ditto.
* random.c (fill_random_seed): ditto.
* ext/pty/pty.c (chfunc): ditto.
(get_device_once): ditto.
* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
* ext/socket/init.c (rsock_socket): ditto.
(rsock_s_accept_nonblock): ditto.
(rsock_s_accept): ditto.
* ext/socket/socket.c (rsock_sock_s_socketpair): ditto.
* ext/socket/ancdata.c (discard_cmsg): ditto.
(make_io_for_unix_rights): ditto.
* ext/socket/unixsocket.c (unix_recv_io): ditto.
* ext/io/console/console.c (console_dev): ditto.
[ruby-core:38140] [Feature #5041]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* thread.c (do_select): remove #ifdef _WIN32. Instead, use
native_fd_select() always.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
blocking thread.
A patch created by Koichi Sasada. [ruby-core:39634] [Bug #5343]
to cover race condition, timer thread periodically send SIGVTARLM to
threads in signal thread list. so you should activate timer thread
when interrupt a thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and pthread_cond_broadcast if they return EAGAIN in
native_cond_signal and native_cond_broadcast, respectively.
It is for the pthread implementation of Mac OS X 10.7 (Lion).
fixes #5155. [ruby-dev:44342].
* thread_pthread.c (native_cond_broadcast): ditto.
* thread_pthread.c (struct cached_thread_entry): stop using
pthread_cond_t and its functions directly.
* thread_pthread.c (register_cached_thread_and_wait): ditto.
* thread_pthread.c (use_cached_thread): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* internal.h (rb_update_max_fd): declare rb_update_max_fd.
* thread_pthread.c (rb_thread_create_timer_thread): update max fd when
timer thread pipe is created.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
[Bug #1813] on AIX.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rb_disable_interrupt()/rb_enable_interrupt().
* vm_core.h: ditto.
* process.c (static void before_exec): ditto.
* process.c (static void after_exec): ditto.
[Bug #4765] [ruby-dev:43571]
* eval_intern.h: removed rb_trap_restore_mask().
* vm_eval.c (rb_throw_obj): ditto.
* eval.c (setup_exception): ditto.
* signal.c: removed trap_last_mask.
* signal.c (trap_restore_mask): removed.
* signal.c (init_sigchld): comment clarification why signal block
is needed. and removed trap_last_mask operation.
* signal.c (trap_ensure): removed trap_last_mask operation.
* signal.c (rb_disable_interrupt, rb_enable_interrupt): made
static and removed sigdelset(SIGVTALARM) and sigdelset(SIGSEGV).
* process.c (rb_syswait): removed implicit signal handler change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
exit(1).
* thread_pthread.c (add_signal_thread_list): ditto.
* thread.c (rb_thread_call_with_gvl): ditto.
* util.c (Bug): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
100,000,000 because Solaris cond_timedwait() return EINVAL if an
argument is greater than current_time + 100,000,000. This is
considered as a kind of spurious wakeup. The caller to native_sleep
should care about spurious wakeup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
pthread_attr_getstack() if possible. and, remove an assumption
of stack growing direction.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
must be the highest address of the current thread's stack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RB_RESERVED_FD_P): added. This C API is to limit to access
fds which are used by RubyVM internal. In this version of
CRuby, return 1 if fd is communication pipe.
If your application needs to close all file descriptors to
preent resource leak, skip internal fds using this C API.
We also define a macro RB_RESERVED_FD_P(fd). So you can write
#ifndef RB_RESERVED_FD_P
#define RB_RESERVED_FD_P(fd) 0
#endif
for Ruby 1.9.2 or previous version to write compatible extensions.
See [ruby-core:37727]
* thread_win32.c (rb_reserved_fd_p): added (return 0 for any fds).
* io.c (rb_io_initialize): raise ArgumentError if given fd is reserved by Ruby.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
return stack start addres, but stack base address. Thus,
we need to add stack size for getting stack start address.
And, we don't have to decrease guard size twice.
* thread_pthread.c (thread_start_func_1): don't use inaccurate
stack start guess if native_thread_init_stack() can be used.
[Bug #1813] [ruby-core:24540]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OS X. [Bug #1813] [ruby-core:24540]
* signal.c (ruby_signal): SIGBUS use alternative stack too.
* signal.c (sigbus): On Mac, thread stack overflow makes SIGBUS
instead of SIGSEGV. thus, added stackoverflow check.
* signal.c (default_handler): get rid of compilation warning.
* signal.c (Init_signal): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
`ignoring return value'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
(we observed that select(2) was canceled by errno=514 on
boron == Linux/Xen environment)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
fix to keep polling state if there are any ping-tasks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
machine stack for the timer thread at least 12KB. FreeBSD 8.2
AMD64 causes machine stack overflow (SIGSEGV) only with
PTHREAD_STACK_MIN (maybe defined as 2KB).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
communication pipe to avoid timing bug (process termination timing).
The communication pipe will closed by OS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In timer thread, signal handler shoul use it.
The patch is contributed by Eric Wong <normalperson@yhbt.net>.
Refs: [ruby-core:37644] and [ruby-core:37647]
* thread_pthread.c: use rb_async_bug_errno().
And replace all fprintf() to write().
* internal.h (rb_async_bug_errno): add decl. of above func.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
Make "buff" as static. (Maybe) "buff" can be shared between
any caller (any threads) because no one use the read values.
And remove const value "buff_size", and define CCP_READ_BUFF_SIZE
macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
style variable length array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
type to void. caller doesn't use it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
s/__gvl_release/gvl_release_common/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
the type of retrun value of write(2) is ssize_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
Fixes missing initialization of oflags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
no waiting thread. If there are 2 or more runnable threads,
the timer thread does polling. Avoid polling makes power save
for several computers (0.2W per a Ruby process, when I measured).
If outside-event such as signal or Thread#kill was occuerred
when the timer thread does not do polling, then wake-up
the timer thread using communication-pipe (the timer thread
waits this communication-pipe with select(2)).
The discussion about this modification can be found from the post
[ruby-core:33456] and other related posts.
Note that Eric Wong and KOSAKI Motohiro give us the huge
contributions for this modification. Thanks.
* thread_pthread.c (rb_thread_wakeup_timer_thread): add a function.
This function wakes up the timer thread using communication-pipe.
* thread.c (rb_thread_stop_timer_thread): add a parameter which
specify closing communication-pipe or not.
* thread.c (rb_thread_terminate_all): do not stop timer thread here
(ruby_cleanup() terminate timer thread).
* signal.c: wake up timer thread using
rb_thread_wakeup_timer_thread() from signal handler.
* eval.c (ruby_cleanup): use rb_thread_stop_timer_thread(1).
* process.c: use rb_thread_stop_timer_thread(0)
(reuse communication-pipe).
* thread_win32.c (rb_thread_wakeup_timer_thread): add a dummy
function.
* vm_core.h: add and fix decl. of functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
time_quantum. it's no longer 10ms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* iseq.h (rb_method_get_iseq): declared.
* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
ruby.c, time.c, util.c, vm.c: don't declare internal functions.
* eval.c, parse.y, thread_pthread.c: non-existing function declarations
removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
(native_thread_data_t::gvl_cond, native_thread_data_t::gvl_next)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
(add last newline)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
system. It's additional fix for r32021.
* thread_pthread.c (gvl_init): add switch_wait_cond.
* thread_pthread.h (typedef struct rb_global_vm_lock_struct): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* thread_pthread.c: remove HAVE_GVL_YIELD macro.
* thread_win32.c (gvl_yield): new. this fallback logic was moved from
rb_thread_schedule_rec().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* thread_win32.c: ditto.
* thread_pthread.h: ditto.
* vm_core.h: ditto.
* thread.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* thread_pthread.c (native_sleep): remove unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
When native_cond_timedwait() return 0 by spurious wakeup, we
don't have to neither 1) call timer_thread_function and 2)
exit the timer thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
this is a regression since r31457. [Bug #4808] [ruby-dev:43606]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* thread_pthread.c (thread_timer): remove EINTR check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|