thread.c (consume_communication_pipe): disarm UBF_TIMER before consume
Same reasoning as the disarm in rb_sigwait_fd_get, the current thread is already processing signals, so we do not need UBF_TIMER to continually kick the process, anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3872ea814c
commit
e3f6429eff
8
thread.c
8
thread.c
@ -4269,6 +4269,14 @@ consume_communication_pipe(int fd)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
int ret = FALSE; /* for rb_sigwait_sleep */
|
int ret = FALSE; /* for rb_sigwait_sleep */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* disarm UBF_TIMER before we read, because it can become
|
||||||
|
* re-armed at any time via sighandler and the pipe will refill
|
||||||
|
* We can disarm it because this thread is now processing signals
|
||||||
|
* and we do not want unnecessary SIGVTALRM
|
||||||
|
*/
|
||||||
|
ubf_timer_disarm();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
result = read(fd, buff, sizeof(buff));
|
result = read(fd, buff, sizeof(buff));
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#define unregister_ubf_list(th)
|
#define unregister_ubf_list(th)
|
||||||
#define ubf_wakeup_all_threads() do {} while (0)
|
#define ubf_wakeup_all_threads() do {} while (0)
|
||||||
#define ubf_threads_empty() (1)
|
#define ubf_threads_empty() (1)
|
||||||
|
#define ubf_timer_disarm() do {} while (0)
|
||||||
|
|
||||||
static volatile DWORD ruby_native_thread_key = TLS_OUT_OF_INDEXES;
|
static volatile DWORD ruby_native_thread_key = TLS_OUT_OF_INDEXES;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user