summaryrefslogtreecommitdiff
path: root/test/fiber/test_mutex.rb
AgeCommit message (Collapse)Author
2024-04-07Prefer to use `Fiber#transfer` in scheduler implementation. (#10479)Samuel Williams
2022-11-09mutex: Raise a ThreadError when detecting a fiber deadlock (#6680)Jean byroot Boussier
[Bug #19105] If no fiber scheduler is registered and the fiber that owns the lock and the one that try to acquire it both belong to the same thread, we're in a deadlock case. Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-06-29Prefer qualified names under ThreadNobuyoshi Nakada
2020-11-08Fix TestFiberMutex#test_condition_variable assertionBenoit Daloze
* Now that it works correctly.
2020-11-07Rename to `Fiber#set_scheduler`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3742
2020-10-01Refined assertions for better failure messagesNobuyoshi Nakada
2020-10-01Remove `Thread.scheduler` from public interface.Samuel Williams
It's implementation is equivalent to: Thread.current.scheduler unless Thread.current.blocking? Notes: Merged: https://github.com/ruby/ruby/pull/3610
2020-09-20Remove from waiter in Mutex#lock with ensure when calling rb_scheduler_block()Benoit Daloze
* Previously this could lead to an invalid waiter entry and then trying to wake up that waiter would result in various issues in rb_mutex_unlock_th().
2020-09-17Fix Mutex#unlock with a scheduler and thread contentionBenoit Daloze
* It would hit "[BUG] unexpected THREAD_STOPPED" before.
2020-09-17Call scheduler.block instead of scheduler.kernel_sleep for blocking ↵Benoit Daloze
Queue/SizedQueue operations * scheduler.unblock was already already called before but with no corresponding scheduler.block * add test that Queue#pop makes the scheduler wait until it gets an element.
2020-09-14Add support for Queue & SizedQueue.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Add support for ConditionVariable.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Make Mutex per-Fiber instead of per-ThreadBenoit Daloze
* Enables Mutex to be used as synchronization between multiple Fibers of the same Thread. * With a Fiber scheduler we can yield to another Fiber on contended Mutex#lock instead of blocking the entire thread. * This also makes the behavior of Mutex consistent across CRuby, JRuby and TruffleRuby. * [Feature #16792] Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Rename `Fiber{}` to `Fiber.schedule{}`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-05-23Rename TestScheduler* to TestFiber for convention of the test directoryHiroshi SHIBATA
2020-05-15Move `test/scheduler` -> `test/fiber` [Bug #16892][ruby-core:98366].Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3110