aboutsummaryrefslogtreecommitdiffstats
path: root/test/fiber/test_mutex.rb
Commit message (Collapse)AuthorAgeFilesLines
* mutex: Raise a ThreadError when detecting a fiber deadlock (#6680)Jean byroot Boussier2022-11-091-1/+21
| | | | | | | | | [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>
* Prefer qualified names under ThreadNobuyoshi Nakada2021-06-291-9/+9
|
* Fix TestFiberMutex#test_condition_variable assertionBenoit Daloze2020-11-081-5/+3
| | | | * Now that it works correctly.
* Rename to `Fiber#set_scheduler`.Samuel Williams2020-11-071-10/+10
|
* Refined assertions for better failure messagesNobuyoshi Nakada2020-10-011-4/+4
|
* Remove `Thread.scheduler` from public interface.Samuel Williams2020-10-011-7/+6
| | | | | | It's implementation is equivalent to: Thread.current.scheduler unless Thread.current.blocking?
* Remove from waiter in Mutex#lock with ensure when calling rb_scheduler_block()Benoit Daloze2020-09-201-0/+32
| | | | | * 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().
* Fix Mutex#unlock with a scheduler and thread contentionBenoit Daloze2020-09-171-0/+23
| | | | * It would hit "[BUG] unexpected THREAD_STOPPED" before.
* Call scheduler.block instead of scheduler.kernel_sleep for blocking ↵Benoit Daloze2020-09-171-0/+25
| | | | | | | 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.
* Add support for Queue & SizedQueue.Samuel Williams2020-09-141-0/+31
|
* Add support for ConditionVariable.Samuel Williams2020-09-141-0/+37
|
* Make Mutex per-Fiber instead of per-ThreadBenoit Daloze2020-09-141-5/+33
| | | | | | | | | * 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]
* Rename `Fiber{}` to `Fiber.schedule{}`.Samuel Williams2020-09-141-2/+2
|
* Rename TestScheduler* to TestFiber for convention of the test directoryHiroshi SHIBATA2020-05-231-1/+1
|
* Move `test/scheduler` -> `test/fiber` [Bug #16892][ruby-core:98366].Samuel Williams2020-05-151-0/+47