aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.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 /bignum.c
parent1a853390ee08af1b8ff3d1882a8762155d151306 (diff)
downloadruby-c51a826764c3307a7fe9258e1d18ddca93cb7b5f.tar.gz
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 'bignum.c')
-rw-r--r--bignum.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bignum.c b/bignum.c
index 3551f4fb6a..d658ce88e1 100644
--- a/bignum.c
+++ b/bignum.c
@@ -10,6 +10,7 @@
**********************************************************************/
#include "ruby/ruby.h"
+#include "ruby/thread.h"
#include "ruby/util.h"
#include "internal.h"
@@ -2591,7 +2592,7 @@ struct big_div_struct {
VALUE stop;
};
-static VALUE
+static void *
bigdivrem1(void *ptr)
{
struct big_div_struct *bds = (struct big_div_struct*)ptr;
@@ -2605,7 +2606,7 @@ bigdivrem1(void *ptr)
j = nx==ny?nx+1:nx;
for (nyzero = 0; !yds[nyzero]; nyzero++);
do {
- if (bds->stop) return Qnil;
+ if (bds->stop) return 0;
if (zds[j] == yds[ny-1]) q = (BDIGIT)BIGRAD-1;
else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
if (q) {
@@ -2633,7 +2634,7 @@ bigdivrem1(void *ptr)
}
zds[j] = q;
} while (--j >= ny);
- return Qnil;
+ return 0;
}
static void
@@ -2725,7 +2726,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
bds.yds = yds;
bds.stop = Qfalse;
if (nx > 10000 || ny > 10000) {
- rb_thread_blocking_region(bigdivrem1, &bds, rb_big_stop, &bds.stop);
+ rb_thread_call_without_gvl(bigdivrem1, &bds, rb_big_stop, &bds.stop);
}
else {
bigdivrem1(&bds);