File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -41,22 +41,25 @@ pub trait IntervalRwLockCore {
4141
4242 /// The storage for per-lock data. Dropping it while it has an associated
4343 /// lock will cause a panic.
44- type ReadLockState ;
44+ type ReadLockState : Default ;
4545
4646 /// Ditto for writer locks.
47- type WriteLockState ;
47+ type WriteLockState : Default ;
4848
4949 /// Ditto for non-blocking reader locks.
50- type TryReadLockState ;
50+ type TryReadLockState : Default ;
5151
5252 /// Ditto for non-blocking writer locks.
53- type TryWriteLockState ;
53+ type TryWriteLockState : Default ;
5454
5555 /// Created by a `LockCallback` implementation when a lock operation is
5656 /// blocked in the middle. It will later be passed to [`UnlockCallback::
5757 /// complete`] when the lock completes.
5858 type InProgress ;
5959
60+ /// The initializer.
61+ const INIT : Self ;
62+
6063 /// Acquire a reader lock.
6164 fn lock_read < Callback : LockCallback < Self :: InProgress > > (
6265 self : Pin < & mut Self > ,
Original file line number Diff line number Diff line change @@ -352,6 +352,8 @@ where
352352 type TryWriteLockState = TryWriteLockState < Index , Priority , InProgress > ;
353353 type InProgress = InProgress ;
354354
355+ const INIT : Self = Self :: new ( ) ;
356+
355357 fn lock_read < Callback : LockCallback < Self :: InProgress > > (
356358 self : Pin < & mut Self > ,
357359 range : Range < Self :: Index > ,
You can’t perform that action at this time.
0 commit comments