Coder Social home page Coder Social logo

Comments (2)

calmh avatar calmh commented on August 17, 2024

Changing these to one-buffered chans resolves the deadlock and makes things work for me. I haven't fully thought through whether there are any other negative consequence, though.

diff --git a/client/connection.go b/client/connection.go
index 0deca91..7d4d694 100644
--- a/client/connection.go
+++ b/client/connection.go
@@ -89,9 +89,9 @@ func Client(nick, ident, name string, r event.EventRegistry) *Conn {
                st:        false,
                in:        make(chan *Line, 32),
                out:       make(chan string, 32),
-               cSend:     make(chan bool),
-               cLoop:     make(chan bool),
-               cPing:     make(chan bool),
+               cSend:     make(chan bool, 1),
+               cLoop:     make(chan bool, 1),
+               cPing:     make(chan bool, 1),
                SSL:       false,
                SSLConfig: nil,
                PingFreq:  3 * time.Minute,

from goirc.

fluffle avatar fluffle commented on August 17, 2024

This should be fixed in the master branch -- I use a single channel close to kill all of the goroutines there. Be warned there are other races too, mostly w.r.t. state tracking. I've been too damn busy to work on fixing it all up, sorry :-/

from goirc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.