~smspillaz/folly/folly-git-master

Viewing all changes in revision 8990.

  • Committer: Facebook GitHub Bot
  • Author(s): Andrii Grynenko
  • Date: 2020-10-24 08:28:23 UTC
  • Revision ID: git-v1:05786142e69a1964c638bb6140b4071462a6fe5b
Make AtomicNotificationQueue::size() TSAN-clean

Summary:
taskExecuteCount_ can be incremented from a single thread, but reading it from another thread is still technically a data race. Mark it as atomic to make TSAN happy.
Also make sure we never return < 0 when called from a non-consumer thread (since we only have the synchronization guarantee on the consumer thread).

Differential Revision: D24523284

fbshipit-source-id: 6185125e132d71a83a3f29c909b7e4eab09e6e79

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: