File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
turbopack/crates/turbo-tasks-backend/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -64,17 +64,24 @@ struct ThreadLocalReadTransactionsContainer(UnsafeCell<SmallVec<[RoTransaction<'
6464
6565impl ThreadLocalReadTransactionsContainer {
6666 unsafe fn pop ( & self ) -> Option < RoTransaction < ' static > > {
67+ // Safety: Access only happens via `push` and `pop`, and
68+ // `ThreadLocalReadTransactionsContainer` is not `Sync`, so we can know we can know this
69+ // block is the only one currently reading or writing to the cell.
6770 let vec = unsafe { & mut * self . 0 . get ( ) } ;
6871 vec. pop ( )
6972 }
7073
7174 unsafe fn push ( & self , tx : RoTransaction < ' static > ) {
75+ // Safety: Access only happens via `push` and `pop`, and
76+ // `ThreadLocalReadTransactionsContainer` is not `Sync`, so we can know we can know this
77+ // block is the only one currently reading or writing to the cell.
7278 let vec = unsafe { & mut * self . 0 . get ( ) } ;
7379 vec. push ( tx)
7480 }
7581}
7682
77- // Safety: It's safe to send RoTransaction between threads, but the types don't allow that.
83+ // Safety: It's safe to send `RoTransaction` between threads as we construct `Environment` with
84+ // `EnvironmentFlags::NO_TLS`, but the types don't allow that.
7885unsafe impl Send for ThreadLocalReadTransactionsContainer { }
7986
8087pub struct LmdbBackingStorage {
You can’t perform that action at this time.
0 commit comments