vendor/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/context.c
/*
 *  call-seq:
 *    context.suspend -> nil
 *
 *  Suspends the thread when it is running.
 */


Suspends the thread when it is running.
Suspends the thread when it is running .
static VALUE
Context_suspend(VALUE self)
{
  VALUE status;
  debug_context_t *context;
  Data_Get_Struct(self, debug_context_t, context);
  status = rb_funcall(context->thread, rb_intern("status"), 0);
  if (rb_str_cmp(status, rb_str_new2("run")) == 0)
    CTX_FL_SET(context, CTX_FL_WAS_RUNNING);
  else if (rb_str_cmp(status, rb_str_new2("sleep")) == 0)
    CTX_FL_UNSET(context, CTX_FL_WAS_RUNNING);
  else
    return Qnil;
  CTX_FL_SET(context, CTX_FL_SUSPEND);
  return Qnil;
}
static VALUE Context_suspend ( VALUE self ) { VALUE status ; debug_context_t * context ; Data_Get_Struct ( self , debug_context_t , context ) ; status = rb_funcall ( context -> thread , rb_intern ( " " ) , 0 ) ; if ( rb_str_cmp ( status , rb_str_new2 ( " " ) ) == 0 ) CTX_FL_SET ( context , CTX_FL_WAS_RUNNING ) ; else if ( rb_str_cmp ( status , rb_str_new2 ( " " ) ) == 0 ) CTX_FL_UNSET ( context , CTX_FL_WAS_RUNNING ) ; else return Qnil ; CTX_FL_SET ( context , CTX_FL_SUSPEND ) ; return Qnil ; }
call-seq:
    context.suspend -> nil
call - seq : context . suspend - > nil