Files
turso/core
Pekka Enberg 41bdf25433 Merge 'Remove public unlock method from SpinLock to prevent unsafe aliasing' from Krishna Vishal
Currently we can create two guards and unlock one of them and still have
two mutable references to the same data.
By being able to unlock only via guard we prevent unsafe scenarios.
Currently, the test below will pass and shows that we can hold two
mutable references to the same data. After this fix, this would result
in a deadlock (have to remove `lock.unlock()`)
```rust
#[test]
fn two_mutable_reference() {
    let lock = SpinLock::new(42);
    let guard = lock.lock();
    lock.unlock();
    let guard2 = lock.lock();

    // two mutable references to same data
    *guard = 10;
    *guard2 = 20;

    assert_eq!(*guard, 20);
    assert_eq!(*guard2, 20);
}
```
Note: The javascript action failure is unrelated to this PR.

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #1194
2025-03-27 20:43:16 +02:00
..
2025-03-24 13:17:57 +02:00
2025-03-24 22:48:07 -04:00
2025-03-27 17:53:02 +01:00
2025-03-24 22:48:07 -04:00
2025-03-27 17:53:02 +01:00
2025-03-25 17:13:31 +02:00
2025-03-27 17:53:02 +01:00
2025-03-27 17:53:02 +01:00
2025-01-28 14:55:38 -05:00
2025-03-25 14:17:31 +01:00
2025-03-05 14:07:48 +01:00
2025-01-28 14:55:38 -05:00
2025-02-11 09:03:36 -04:00
2025-02-06 13:40:34 +02:00
2024-12-24 18:04:30 +01:00
2025-03-27 17:54:32 +01:00
2025-03-24 20:21:09 -03:00