From: student_vienna@... (daniel) Date: 2003-04-17T22:02:20+09:00 Subject: Re: extension - redirect a block "ts" wrote in message news:200304171134.h3HBY5r29784@moulon.inra.fr... > >>>>> "d" == daniel writes: > > d> But in my thread which is listen on ``com1å¹¹, rb_block_given_p > d> says that no block is given. > d> How to ``redirectå¹¹ the block in the init function? > > Well I've not understood : do you want to do something like this ? > [...] > Not really... In Ruby I call rv.rPAInit { |a| Callback_fn(a) } and use this block in my c-routines (in my dll). And I need the block in another function! In my wrapping-init function (in the dll, c-code) the block is there and rb_yield does the right things. But in another function (my thread) rb_block_given_p says there is no block and so I can't do rb_yield. But I need the block in the thread... I'v tried some things like the example in the ruby-html-docu (the CD-Player...) but rb_block_given_p fails (in my thread). Also: In the c-function which wrapped rPAInit the block is there. In my thread the block is not there - but I need the the block in my thread. I don't know how to redirect the block... It's all c-code daniel