#include <ruby.h>

VALUE yarv_yield _((VALUE val));

/* original API */
RUBY_EXTERN int yarvIsWorking;
#define IS_YARV_WORKING() (yarvIsWorking)
#define SET_YARV_START()  (yarvIsWorking = 1)
#define SET_YARV_STOP()   (yarvIsWorking = 0)

VALUE yarv_get_current_running_thread _(());


struct yarv_yield_data{
  VALUE *lfp;
  VALUE *dfp;
  VALUE *cfp;
  VALUE *sp_start;
  VALUE *sp;
  VALUE *pc;
  int local_size;
};

VALUE thread_yield_light_prepare _((VALUE self, int argc, VALUE *argv,
                                    struct yarv_yield_data *data));
