I have a threaded connection:

class ThreadedConnection : Connection {
    protected Thread _thread = null;
    @property Thread thread() { return _thread; }

    void run() {
        if(_thread is null) {
            _thread = new Thread(&(super.run));
            _thread.isDaemon = true;
        }

        _thread.start();
    }
}


The thread will call &super.run:

    void run() {
        while(_connected) {
            poll();
        }
    }


Since this is a daemon thread, I'd expect it to stop/terminate when the main thread stops. This is not the case (it keeps running), is this a known bug and how can I workaround this?

It also seems that it keeps running, even if I close the connection and super.run stops.

Reply via email to