OpenRTMFP / Cumulus

CumulusServer is a complete open source and cross-platform RTMFP server extensible by way of scripting
http://groups.google.com/group/openrtmfp-cumulus
GNU General Public License v3.0
593 stars 221 forks source link

A bug when starting threads? #79

Closed Poechant closed 11 years ago

Poechant commented 12 years ago

I found that some threads of Cumulus could not start correctly or even cannot start up. The environment for running Cumulus is Linux. Sometimes MainSockets doesn't start, sometimes RTMFPManager doesn't and sometimes others don't.

Then I found maybe there is a bug in Startable class:

    void Startable::start() {
        ...
        _thread.start(_process);
        _haveToJoin = true;
        ScopedLock lock(_mutexStop);
        _stop=false;
        ...
    }

Perhaps should set the bool member "_stop" of Cumulus::Startable false before calling _thread.start(...):

    void Startable::start() {
        ...
        {
            ScopedLock lock(_mutexStop);
            _stop=false;
        }
        _thread.start(_process);
        _haveToJoin = true;
        ...
    }
cumulusdev commented 11 years ago

Hi, The problem was on a code to set the priority thread, it's fixed in the new version.