SensorManager mutex?



  • Do I need to use a mutex when using the SensorManager singleton or calling any of its functions? I get "device or resource busy" when I call any of the "get sensor" functions on the singleton. Could you also give a simple example that shows how to access a sensor by ID from within a plugin? The online documentation doesn't have one.



  • @rr And a clarification/follow up: should I expect the sensor to be locked when I use SensorManager to access it from inside its own Update() function? E.g.:

    MySensor::Update(dt) {
    SensorManager &sm = ...
    sm.GetSensor(m_specializedSensorID); // I get an exception here ("device or resource busy")
    }

    or:

    MySensor::Update(dt) {
    SensorManager &sm = ...
    vector<Sensor*> sensors = sm.GetAllSensors(); // I get an exception here ("device or resource busy")
    }


Log in to reply
 

Looks like your connection to ANVEL Forum was lost, please wait while we try to reconnect.