From: Peter Zotov Date: 2012-04-30T00:11:02+09:00 Subject: Re: What is the meaning of rb_thread_interrupted() ? Eric Wong писал 29.04.2012 12:02: > 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 :)). Try Ruby Cross Reference -- it uses ctags inside and has full-text search. http://rxr.whitequark.org/ -- WBR, Peter Zotov.