From: Eric Wong Date: 2012-04-29T17:02:07+09:00 Subject: Re: What is the meaning of rb_thread_interrupted() ? I単aki Baz Castillo wrote: > Hi, I'm coding a Ruby C extension and would like to know the meaning > of rb_thread_interrupted() function defined in thread.c, whose > content is: The best way to know the meaning of a function is often to see how it's used in existing code. > And RUBY_VM_INTERRUPTED(th) is defined as: > > #define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & 0x02) > > So, when does rb_thread_interrupted() return 1 or 0? See when Ruby sets the 0x02 bit on th->interrupt_flag and work backwards from there. For navigating/learning codebases, I always use (exuberant-)ctags, (git) grep, and sometimes cflow. (I could answer your questions directly, but I'd rather teach you how to be a better fisherman (or source diver :)).