From 97ef1cfd699640e40d2d63746d005f4f4cf6a863 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 20 Feb 2010 14:52:16 -0800 Subject: POSIX_MQ#<< does not release GVL when non-blocking Missed this with the other change --- ext/posix_mq/posix_mq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext/posix_mq/posix_mq.c') diff --git a/ext/posix_mq/posix_mq.c b/ext/posix_mq/posix_mq.c index 5b7a3ed..e1ad5f1 100644 --- a/ext/posix_mq/posix_mq.c +++ b/ext/posix_mq/posix_mq.c @@ -470,7 +470,12 @@ static VALUE send0(VALUE self, VALUE buffer) x.timeout = NULL; x.msg_prio = 0; - rv = (mqd_t)rb_thread_blocking_region(xsend, &x, RUBY_UBF_IO, 0); + if (mq->attr.mq_flags & O_NONBLOCK) + rv = (mqd_t)xsend(&x); + else + rv = (mqd_t)rb_thread_blocking_region(xsend, &x, + RUBY_UBF_IO, 0); + if (rv == MQD_INVALID) rb_sys_fail("mq_send"); -- cgit v1.2.3-24-ge0c7