How to “unlock” an RwLock?
问题 I'm trying to solve the thread-ring problem. In each thread I read the token value if it is not mine, check if it's the end of the program if it is then finish the thread otherwise, read again and repeat if it is mine (i.e. has my id) then acquire the write lock, increase the value of the token, check if it's the end then tell main thread that I finished it and finish the current thread loop If it not over, then release the write lock, and start to read again There is no unlock. Is there any