Page MenuHomePhabricator

[TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 1
ClosedPublic

Authored by yln on Apr 5 2019, 4:49 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

yln created this revision.Apr 5 2019, 4:49 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 5 2019, 4:49 PM
Herald added subscribers: llvm-commits, Restricted Project, kubamracek. · View Herald Transcript
yln updated this revision to Diff 193985.Apr 5 2019, 5:00 PM

Use separate exitBarrier.

General point: Should we actually be using the TSan-invisible barrier for this purpose? Maybe a "normal" primitive, like a dispatch semaphore would make this more clear that we're just trying to tell the main thread that we're done.

compiler-rt/test/tsan/Darwin/gcd-after.mm
2 ↗(On Diff #193985)

Please make this change separately.

yln updated this revision to Diff 193993.Apr 5 2019, 6:11 PM

Use dispatch_semaphore wrapped in helper functions to better express intent
in tests.

yln updated this revision to Diff 193994.Apr 5 2019, 6:16 PM
yln marked an inline comment as done.

Missed one test file.

Can you please embed all the functions into the tests themselves and drop the header file?

compiler-rt/test/tsan/Darwin/gcd-after.mm
29 ↗(On Diff #193994)

This rewrite is changing the behavior. We should have two separate waits.

yln updated this revision to Diff 194201.Apr 8 2019, 1:28 PM

Don't use header file.

yln marked an inline comment as done.Apr 8 2019, 1:29 PM
yln retitled this revision from [TSan][libdispatch] Replace CFRunLoop with barriers, pt. 1 to [TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 1.Apr 8 2019, 2:09 PM
yln added a reviewer: dvyukov.
yln added a comment.Apr 9 2019, 10:06 AM

@dvyukov
Do you have any comments/preferences of porting the libdispatch tests to Linux, Dmitry?

As long as the tests pass, it's fine with me :)

This revision was not accepted when it landed; it landed in state Needs Review.Apr 9 2019, 10:51 AM
This revision was automatically updated to reflect the committed changes.