RubyInline passing VALUE with pthread

I am trying to apply C multithreading to a ruby class method
Here is the code:

require 'inline'

class Example

  inline :C do |builder|
  builder.include "<pthread.h>"

    builder.c '
    static void run_thread(VALUE name){
        // I added a ruby User class to test posting a variable from
thread to db
        VALUE user = rb_const_get( rb_cObject, rb_intern("User") );
        rb_funcall(user, rb_intern("add"), 1, name);

    builder.c '
    static void simple(VALUE name){
        run_thread(self, name);

    builder.c '
    static void threads(VALUE name){
        pthread_t pth;

        pthread_create(&pth, NULL, (void *)run_thread, (VALUE *)name );

        pthread_join(pth, NULL);


if I run"Adam") i get the expected result