ext: note we rely on GVL for reentrancy detection
authorEric Wong <normalperson@yhbt.net>
Wed, 20 Jul 2011 21:01:56 +0000 (20 14:01 -0700)
committerEric Wong <normalperson@yhbt.net>
Wed, 20 Jul 2011 21:01:56 +0000 (20 14:01 -0700)
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.

ext/clogger_ext/clogger.c

index e8cbfdc..e1fcecb 100644 (file)
@@ -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);