From: Jan Arne Petersen Date: 2001-07-06T08:45:49+09:00 Subject: [ruby-talk:17355] Re: Block between DEFER_INTS and ALLOW_INTS ts wrote: >>>>>>"J" == Jan Arne Petersen writes: >>>>>> > > J> What is the meaning if a block of code is between DEFER_INTS and ALLOWINTS. > > Just look at rubysig.h > > #define DEFER_INTS {rb_prohibit_interrupt++;} > #define ALLOW_INTS {rb_prohibit_interrupt--; CHECK_INTS;} > > # define CHECK_INTS if (!rb_prohibit_interrupt) {\ > if (rb_trap_pending) rb_trap_exec();\ > if (rb_thread_pending && !rb_thread_critical) rb_thread_schedule();\ > } > > ruby will not check the interrupts for this block, nor will try to > re-schedule the thread. I haven't looked at the thread-stuff so far. > J> Is this something like synchronization in Java? > > Something like Not really the *_INTS-block is obvious something like an atomic operation. Jan Arne Petersen