I'm writing a C++ program (on Centos 5 Linux) that embeds a Ruby 1.9.3
p327 interpreter. It mostly works, but I'm getting a strange error from
a script called by the program. When run from the command line (i.e. not
embedded), the script works correctly. The error is:
    undefined method `synchronize' for #<Mutex:0xa0f5adc>
If I search back over this list's archives, I can see a few other people
with the same problem (but no solution).

I've narrowed it down to the following test program:

#include <ruby.h>

int
main(int argc, char *argv[])
{
    RUBY_INIT_STACK;
    ruby_init();
    ruby_init_loadpath();

    rb_eval_string("$mutex = Mutex.new");
    rb_eval_string("$mutex.synchronize(){}");

    return 0;
}

Does anybody have any clues, please?

Thanks, Graham