BackgroundWorker may not be thread safe
jeffssss opened this issue · 2 comments
jeffssss commented
I read both BackgroundWorker
and https://academy.realm.io/posts/realm-notifications-on-background-threads-with-swift/
and I found that maybe BackgroundWorker
is not thread safe.
when I call BackgroundWorker.shared.start(_)
simultaneously in other threadA and B (A and B save difference data), There is a certain probability that BackgroundWorker execute A or B twice.
I wonder if it's really a problem? or if it is conformance to expectation。
Cliff-F commented
This certainly happens. It is not thread safe.
Cliff-F commented