[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Work around for wait with timeout and count_waiters

Sharat Mohan

2/11/2009 4:00:00 PM

I was using following code in ruby 1.8

def self.wait_for_completion_on(signal_data)
signal_data.lock.synchronize do
if signal_data.lock.count{|i| !i.nil?} > 0
signal_data.lock.clear
else
k = 0
while k < SipperConfigurator[:WaitSecondsForTestCompletion]
signal_data.cond.wait(3)
break if signal_data.lock.count{|i| !i.nil?} > 0
end
end
end
end


def self.signal_waiting_test(test_name, proxy_call=false)
signal_data = SIP::Locator[:Tlocks][test_name] if
SIP::Locator[:Tlocks]
unless signal_data
return false
end
signal_data.lock.synchronize do
signal_data.lock << "signal"
if signal_data.cond.count_waiters > 0
signal_data.cond.signal
else
SipLogger['siplog::sip_testcompletionsignalinghelper'].debug
"Queueing the signal"
end
end
end

But now moving to 1.9, wait with timeout on cond variable and
count_waiters is not implemented in montior.rb. What should be the
workaround?
--
Posted via http://www.ruby-....

1 Answer

Sherry in Vermont

3/17/2011 7:09:00 PM

0

On 2011-03-17 13:36:10 -0400, booie <bababooie714@gmail.com> said:

> On Mar 16, 12:54?pm, Sherry in Vermont <sherr...@together.net> wrote:
>>> My Oxford, Maine touring partner has passed away.
>
> bbb writes:
> Do ya know what that is like?
> Again I ask, do you know what that is like???
>
> I used to tour pretty hard. Shows here and there.
> Plenty of out of state shows. Some for weeks on end.
> Once in a while I would take friends as riding partners.
> Ya know some good conversations, turning a friend on to a unique and
> great experience, spliting the cost of the gas, a person to read the
> map for you, and the after the show ride home to talk about the whole
> experience.
> Do ya know what that is like?
>
> That might be as big as 1/2 the whole experience.
> The riding partner adds so much to the experience.
>
> I have many riding partners for a couple of tours.
> I am still in touch with many of them.
> The nor-easter Richfield, Ohio blast.
> If I did not have a riding partner then I would have never stayed in
> the hotel that we did.
> Thayt was one wicked scene!!!
>
> I am still in touch with that guy, kinda my best friend.
>
> All the Spectrum's, the RFK's, the MSG's, all the Rochester's and all
> the Saratoga's shows.
> Riding partners for all of them.
>
> When you ride with someone, it is nice.
> And when you take/took a newbie it was like watching someone getting
> hooked on a good scene.
>
> Thanks for the memories payton.
> I can hear his voice on the end of track 13
> http://www.archive.org/details/Oxford...Maine...7...3...1988...I...
>
>
> booie........
>
>
> You have any good/bad experiences with a riding partner that was with
> you for any Grateful Dead concerts???


I never drove to any shows until the past 5 or 6 years... usually I
ride with a friend. I have been friends with my touring partners ever
since - some 30 yrs. :) The guy who drove the van during most of the
shows I've seen is my best friend for 27 years now. The adventures and
crazy trips the group of us had was amazing... I don't remember all of
them clearly, but boy they sure were fun!

Sherry in Vermont