Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronize type cache map access/mutations (#106)
The serialization layer caches types during serialization and deserialization. See [1](https://github.com/stealthrocket/coroutine/blob/d21c0e06b98e87aca6eb4ebfa7901a9e85597d72/types/types.go#L163-L179), [2](https://github.com/stealthrocket/coroutine/blob/d21c0e06b98e87aca6eb4ebfa7901a9e85597d72/types/typemap.go#L99) and [3](https://github.com/stealthrocket/coroutine/blob/d21c0e06b98e87aca6eb4ebfa7901a9e85597d72/types/typemap.go#L146-L169). If multiple goroutines are serializing or deserializing durable coroutine state concurrently, a `concurrent map read and map write` failure may be observed. This PR fixes the issue by synchronizing goroutines with a mutex.
- Loading branch information