Skip to content

BaseDevice enable/disable thread safety #19

Description

@MB3hel

Currently, BaseDevice class makes no attempt to support thread-safe access around enable / disable
Eg motor controller class implements its own mutex. Child classes should not be (fully) responsible for ensuring thread safety.

Operating functions of a child device class (eg setSpeed for motor controllers) should be given a way to ensure they are thread-safe with respect to enable/disable operations (which themselves may either be called from network thread or main thread).

Simplest approach would be requiring a child to instantiate a lock guard before checking enable state in a function. Not ideal though as child still has to comply.

Perhaps some way of delegating performing actions down to base class code. Not entirely sure what this would look like. And would probably be more complex base class wise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions