I write a simple bot using “SimpleMUCClient”. But got error: app.rb:73:in stop': deadlock detected (fatal)‘. How to fix it?
from app.rb:73:in
I write a simple bot using SimpleMUCClient. But got error: app.rb:73:in stop’: deadlock detected
Share
Most likely the code you’re running is executed in another thread. That particular thread is then joined (meaning Ruby waits for it to finish upon exiting the script) using
Thread.join(). CallingThread.stop()while also calling.join()is most likely the cause of the deadlock. Having said that you should following the guides of StackOverflow regarding how to ask questions properly, since you haven’t done so I’ve down voted your question.Joining a thread while still calling
Thread.stopcan be done as following:It’s not the cleanest way but it works. Also, if you want to actually terminate a thread you’ll have to call
Thread.exitinstead.