Skip to content

Shared Variables queue issue #2

Closed
@pnndra

Description

@pnndra

it seems to me that the line below is wrong:
https://github.com/bcmi-labs/ArduinoThreads/blob/9f652184c5bbc5356e619b5fbc4e4791ea208de0/Arduino_Threads.h#L17

basically it's putting a reference to the current object in the queue but since the object is not copied, in case two elements are put in the queue these will contain the same pointer and when reading the value both items will return the same as they're reading the member of the object, which in the meantime may even have changed again.
https://github.com/bcmi-labs/ArduinoThreads/blob/9f652184c5bbc5356e619b5fbc4e4791ea208de0/Arduino_Threads.h#L9-L13

if we want to really have a queue of more than one item we need to allocate memory for that and push/pull values from there.

bottom line: do we really need more than one item in the queue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions