From: Eric Wong Date: Wed, 20 Jul 2011 21:01:56 +0000 (-0700) Subject: ext: note we rely on GVL for reentrancy detection X-Git-Tag: v1.1.0~4 X-Git-Url: https://repo.or.cz/w/clogger.git/commitdiff_plain/99d9141f5d57e286c8205b13c41dde34b4bca16d ext: note we rely on GVL for reentrancy detection Nothing wrong with the GVL in Ruby 1.9.3; but we'll need to modify our code if it's removed for C extensions. --- diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c index e8cbfdc..e1fcecb 100644 --- a/ext/clogger_ext/clogger.c +++ b/ext/clogger_ext/clogger.c @@ -890,10 +890,12 @@ static VALUE clogger_call(VALUE self, VALUE env) env = rb_check_convert_type(env, T_HASH, "Hash", "to_hash"); if (c->wrap_body) { + /* XXX: we assume the existence of the GVL here: */ if (c->reentrant < 0) { VALUE tmp = rb_hash_aref(env, g_rack_multithread); c->reentrant = Qfalse == tmp ? 0 : 1; } + if (c->reentrant) { self = rb_obj_dup(self); c = clogger_get(self);