dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.3.1 | You're being logged at https://irclog.whitequark.org/cinch/
Azure has quit [Read error: Connection reset by peer]
Azure has joined #cinch
<bougyman> wo
<bougyman> dominikh: yt?
<bougyman> I can't change @bot.nick inside a Signal.trap block anymore
<bougyman> but I know I used to do this.
<bougyman> must be new in the ruby version?
<dominikh> didn't ruby change something about what's permissible in signal handlers?
<dominikh> no mutexes anymore, etc
<bougyman> I think so
<bougyman> so...
<bougyman> any way around this?
<bougyman> When I get a TERM, I want to change the bots nick, and fire a timer to bot.quit in 120 seconds
<bougyman> this worked for a long time. I don't recall upgrading ruby anytime soon here (not major versions, anyway)
<bougyman> oh wait.
<dominikh> i.e. do what's sane to do in signal handlers: set a variable, process it outside the handler. of course I have no idea how to do that in Ruby, lacking volatile and forbidding synchronisation
<bougyman> someone upgraded it to 2.3.
<bougyman> Ah, ok.
<bougyman> that'll work.
<bougyman> thanks
<dominikh> you still gonna maintain Cinch? else I'll archive the repo soon
<bougyman> Of coz.
<bougyman> Finally had time to look at issues and pull some PRs
<bougyman> I'm getting "free time" again!!
<dominikh> yay.
<bougyman> I set an instance variable in the signal handler and I'm processing it in a Timer.
<bougyman> we'll see if that works.
<dominikh> sounds racy ;)
<bougyman> naw. the only place it's set is in the handler, and the only place that uses it is the timer.
<dominikh> what if reading the value is interrupted by the signal handler writing it? will it read garbage?
<dominikh> what's Ruby's memory model like
<bougyman> If they're in different threads, wouldn't the GIL prevent that?
<bougyman> still have a GIL in ruby
<dominikh> lol.
<bougyman> and yeah, that didn't work.
<bougyman> oh... haha
<bougyman> two threads are fighting
<bougyman> It worked, but I had a nother thread that likes to set the nick, too. Had to have that one honor the new variabls, as well. All good now.
<Rennex> yeah synchronization isn't an issue when you don't do a read-update-write, so just setting a flag that someone else can check soonish is not a problem