1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

17 commits

Author SHA1 Message Date
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
a731125f12 applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:10:53 +02:00
Matthew Draper
fe7d77cc01 Test the happy path for recursive yields too 2016-02-08 05:30:10 +10:30
thedarkone
5d9e591313 Fix a nonsensical ShareLock test. 2016-02-07 19:13:16 +01:00
thedarkone
9f2df7856d AS::Conc::ShareLock#yield_shares tests. 2016-02-07 01:01:51 +01:00
Matthew Draper
3e4a69e52d Hand off the interlock to the new thread in AC::Live
Most importantly, the original request thread must yield its share lock
while waiting for the live thread to commit -- otherwise a request's
base and live threads can deadlock against each other.
2016-02-07 08:32:27 +10:30
Matthew Draper
f836630f8c After completing a load, give other threads a chance too
While we know no user code is running, we should do as much loading as
we can. That way, all the threads will then be able to resume running
user code together.

Otherwise, only the last arriving thread would get to do its load, and
would then return to userspace, leaving the others still blocked.
2016-02-02 03:21:03 +10:30
Matthew Draper
f02bd2a92c While new sharers are blocked, an existing sharer remains re-entrant 2016-02-02 03:21:03 +10:30
Matthew Draper
aeb58ab704 Block new share attempts if there's an exclusive waiter 2016-02-02 03:21:03 +10:30
Jerry D'Antonio
23b6f65fd1 Require only necessary concurrent-ruby classes. 2015-11-04 21:12:28 -05:00
thedarkone
5d6770754e Small tweaks to mainly lock-ordering tests.
* only test the upgrade path,
* add test to verify non upgrades can’t preempt,
* add reentrancy assertion.
2015-07-22 22:59:01 +02:00
Matthew Draper
e9020ac431 Handle thread death during lock acquisition
Specifically, clean up if the thread is killed while it's blocked
awaiting the lock... if we get killed on some other arbitrary line, the
result remains quite undefined.
2015-07-21 12:03:38 +09:30
Matthew Draper
4c54b2a9a0 Adjust expectations around purpose/compatibility options 2015-07-21 12:03:38 +09:30
Matthew Draper
ef4d334272 Add some meta-assertions for the custom assertions
I accidentally discovered `assert_threads_not_stuck` couldn't fail, so
the simplest solution was to prove they're all now working in both
directions.
2015-07-21 12:00:52 +09:30
Matthew Draper
649d8173c3 Order of execution is only guaranteed if upgrading
If the thread isn't yet holding any form of lock, it has no claim over
what may / may not run while it's blocked.
2015-07-21 08:50:50 +09:30
thedarkone
9c4da24aca Tests for AS::Concurrency::ShareLock. 2015-07-20 19:01:11 +02:00