Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Commit

Permalink
inet_diag: do not set unblocking function
Browse files Browse the repository at this point in the history
netlink is fast and predictable in response times, so permitting
interrupts would just complicate things and lead to errors.
  • Loading branch information
Eric Wong committed Mar 12, 2011
1 parent 3a2fe1f commit 8f12e06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ext/raindrops/linux_inet_diag.c
Expand Up @@ -14,7 +14,6 @@
/* partial emulation of the 1.9 rb_thread_blocking_region under 1.8 */
#ifndef HAVE_RB_THREAD_BLOCKING_REGION
# include <rubysig.h>
# define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
typedef void rb_unblock_function_t(void *);
typedef VALUE rb_blocking_function_t(void *);
static VALUE
Expand Down Expand Up @@ -420,7 +419,7 @@ static VALUE tcp_stats(struct nogvl_args *args, VALUE addr)
gen_bytecode(&args->iov[2], &query_addr);

memset(&args->stats, 0, sizeof(struct listen_stats));
nl_errcheck(rb_thread_blocking_region(diag, args, RUBY_UBF_IO, 0));
nl_errcheck(rb_thread_blocking_region(diag, args, 0, 0));

return rb_listen_stats(&args->stats);
}
Expand Down Expand Up @@ -508,7 +507,7 @@ static VALUE all_tcp_listener_stats(VALUE obj)
args.table = st_init_strtable();
gen_bytecode_all(&args.iov[2], AF_INET);

nl_errcheck(rb_thread_blocking_region(diag, &args, RUBY_UBF_IO, 0));
nl_errcheck(rb_thread_blocking_region(diag, &args, NULL, 0));
rv = rb_hash_new();
st_foreach(args.table, st_to_hash, rv);
st_free_table(args.table);
Expand Down

0 comments on commit 8f12e06

Please sign in to comment.