Storage is not thread-safe. By using Lock(), users can achieve the purpose of ensuring thread safety.
()
| 69 | // Storage is not thread-safe. |
| 70 | // By using Lock(), users can achieve the purpose of ensuring thread safety. |
| 71 | Lock() |
| 72 | Unlock() |
| 73 | |
| 74 | // Usually, Storage is filled first, then user can read it. |
no outgoing calls