Skip to content

Len and Close look racy #2

@krolaw

Description

@krolaw

self.closed has no lock. I know that it's only a bool, but two threads could potentially write and read to this variable at the same time. And Len is trying to read over a buffer, during potential writes and reads. I'm a new comer to Zig, but this would definitely be a race in Go and I'd expect the race detector to spot this (with enough iterations).

https://stackoverflow.com/questions/9200951/is-it-ok-to-read-a-shared-boolean-flag-without-locking-it-when-another-thread-ma

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions