Commit Graph

9 Commits

Author SHA1 Message Date
Mike Ash
855dd8d5fb [Tests] Use a plain array of std::atomic rather than a vector of atomic.
The restrictions on std::atomic make a it fragile to have a vector of them, and this failed to compile on Linux in CI.

While I'm in there, clean up a couple of tests that repeated a raw `10` for the thread count.

rdar://problem/49709062
2019-04-09 10:52:53 -04:00
Mike Ash
6172f72af9 [Tests] Make Mutex.cpp tests more reliable.
Many of these tests would fail if one of the test threads didn't begin execution within 100 milliseconds. They would hit while (!done) the very first time and never execute the loop body. That does happen from time to time, and the result would be a spurious failure. Change the loops to do {} while(!done) to ensure they always execute at least one iteration.

Many tests also had the test threads concurrently write results to a std::vector, which appeared to be causing some failures in my local testing when I had extra sleeps inserted to simulate pathological scheduling. Change the results vectors to be vectors of std::atomic to ensure that this concurrent writing is safe.

These changes shouldn't affect its ability to test the functionality it intends to test.

rdar://problem/49386389
2019-04-05 16:40:08 -04:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Shawn Erickson
d78c6e3403 [runtime] addressed review comments outlined in #1950 2016-04-28 10:39:35 -07:00
Shawn Erickson
a0452be947 [runtime] enhanced and refactored recently added Mutex abstraction
- added read / write lock support
- added non-fatal error support to allow use of mutex in fatal error reporting pathway
- isolated pthread implementation to it own header/cpp file pair
- expanded unit tests to cover new code as well as better test existing mutex
- removed a layer of complexity that added no real value
2016-04-06 13:02:37 -07:00
Ben Langmuir
fa77a7afc9 Fix race condition in Mutex LockableThreaded test
If the thread starts slowly enough it will succeed in taking the lock,
leading to a deadlock. We saw this test hanging on some of our bots
inside of pthread's lock acquire.
2016-04-01 11:06:48 -07:00
Shawn Erickson
aeceb2cad8 [runtime] Addressed PR1731 comments and...
- cleaned up private scoping
- removed generally unneeded API
- fix defect in unit tests causing stuck threads
2016-03-23 22:54:36 -07:00
Shawn Erickson
2f84220712 [runtime] added Mutex, Condition, and Scoped locks for use by Swift runtime (see SR-946) 2016-03-20 22:56:24 -07:00