Skip to content

[Bug] Backing type properties can become out of sync due to concurrent access across threads #125

@graycampbell

Description

@graycampbell

Swift Version

6.0

Package Version

0.2.1

Bug Description

Right now, in a backing type (e.g. MockReturningNonParameterizedMethod), in a method like invoke, atomic operations are conducted using individual locks for each property (e.g. callCount and returnedValues). Since they are using separate locks, it's possible for these properties to be out of sync at any moment in time when invoke is being called concurrently across threads.

Steps to Reproduce

This isn't particularly easy to reproduce. You would need to try to force concurrent calls to invoke across threads. This is more of a theoretical bug than one that's been experienced. It was raised as a potential issue here.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions