Post

rust--读写锁的读写模式

rust--读写锁的读写模式

读写锁RWLock的读写

1
2
3
4
5
6
    //读
    & *rwlock.read()
    //写:对内部值进行操作
    &mut *rwlock.write()
    //写:对内部值进行重置
    *rwlock.write() = value;
This post is licensed under CC BY 4.0 by the author.