Serial queues need extra happens-before between individual tasks executed in the same queue. This patch adds Acquire(queue) before the executed task and Release(queue) just after it (for serial queues only). Added a test case.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Do you mean that work items can be executed on different threads for serial queues? If so, add a comment here, because it is not completely obvious.
Updated patch.
Also, please move Acquire call to a separate line.
It's clang-format (Google style) doing this. Is there some extra setting I should be using? Should we add it to the .clang-format file we have in lib/tsan?
It's clang-format (Google style) doing this. Is there some extra setting I should be using? Should we add it to the .clang-format file we have in lib/tsan?
Ah, OK, I am more than happy with any automatic formatting. Please format it back. Sorry.
I've looked at other .clang-format files, they all are just "BasedOnStyle: Google". It does not make sense to have different rules for tsan.
At some point we need to reformat all tsan sources. I don't want to step on your work, so I can do it later, or you can do it now.