about summary refs log tree commit homepage
path: root/ext/posix_mq/posix_mq.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-02-20 14:52:16 -0800
committerEric Wong <normalperson@yhbt.net>2010-02-20 14:52:16 -0800
commit97ef1cfd699640e40d2d63746d005f4f4cf6a863 (patch)
tree4eeef8a2d94944aef77c1727c43c5a5490a4fd10 /ext/posix_mq/posix_mq.c
parent5849a3ca8e0691a7f39c5cdbfc09fc34ee4da308 (diff)
downloadruby_posix_mq-97ef1cfd699640e40d2d63746d005f4f4cf6a863.tar.gz
POSIX_MQ#<< does not release GVL when non-blocking
Missed this with the other change
Diffstat (limited to 'ext/posix_mq/posix_mq.c')
-rw-r--r--ext/posix_mq/posix_mq.c7
1 files changed, 6 insertions, 1 deletions
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");