summaryrefslogtreecommitdiff
path: root/ext/socket/ancdata.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-10 13:57:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-10 13:57:11 +0000
commitc51a826764c3307a7fe9258e1d18ddca93cb7b5f (patch)
treeb6139e61fe139e418a606ff611b0b6c30ce30dfe /ext/socket/ancdata.c
parent1a853390ee08af1b8ff3d1882a8762155d151306 (diff)
rb_thread_call_without_gvl
* include/ruby/thread.h: new header file for thread stuff. * thread.c (rb_thread_call_without_gvl): export. [Feature#4328] returns void* instead of VALUE. [Feature #5543] * thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r--ext/socket/ancdata.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 52f92a1..5af090c 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1110,11 +1110,11 @@ struct sendmsg_args_struct {
int flags;
};
-static VALUE
+static void *
nogvl_sendmsg_func(void *ptr)
{
struct sendmsg_args_struct *args = ptr;
- return sendmsg(args->fd, args->msg, args->flags);
+ return (void *)sendmsg(args->fd, args->msg, args->flags);
}
static ssize_t
@@ -1124,7 +1124,7 @@ rb_sendmsg(int fd, const struct msghdr *msg, int flags)
args.fd = fd;
args.msg = msg;
args.flags = flags;
- return rb_thread_blocking_region(nogvl_sendmsg_func, &args, RUBY_UBF_IO, 0);
+ return (ssize_t)rb_thread_call_without_gvl(nogvl_sendmsg_func, &args, RUBY_UBF_IO, 0);
}
static VALUE
@@ -1368,12 +1368,12 @@ rsock_recvmsg(int socket, struct msghdr *message, int flags)
return recvmsg(socket, message, flags);
}
-static VALUE
+static void *
nogvl_recvmsg_func(void *ptr)
{
struct recvmsg_args_struct *args = ptr;
int flags = args->flags;
- return rsock_recvmsg(args->fd, args->msg, flags);
+ return (void *)rsock_recvmsg(args->fd, args->msg, flags);
}
static ssize_t
@@ -1383,7 +1383,7 @@ rb_recvmsg(int fd, struct msghdr *msg, int flags)
args.fd = fd;
args.msg = msg;
args.flags = flags;
- return rb_thread_blocking_region(nogvl_recvmsg_func, &args, RUBY_UBF_IO, 0);
+ return (ssize_t)rb_thread_call_without_gvl(nogvl_recvmsg_func, &args, RUBY_UBF_IO, 0);
}
#if defined(HAVE_ST_MSG_CONTROL)