[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: What is the meaning of =?UTF-8?Q?rb=5Fthread=5Finterrupted=28?= =?UTF-8?Q?=29=20=3F?=
From:       Peter Zotov <whitequark () whitequark ! org>
Date:       2012-04-29 15:11:02
Message-ID: 1213afe53a404c635a0990af8c8d5471 () whitequark ! org
[Download RAW message or body]

Eric Wong писал 29.04.2012 12:02:
> Iñaki Baz Castillo <ibc@aliax.net> 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.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic