You don't seem to need a “context” (whatever that means); instead, you are looking for a PRNG implementation where you can save and restore the current state. This is really possible with any PRNG implementation that you implement yourself (since you can always save state), while library functions may or may not give you access to the state.
For Linux and MacOS, they actually added rand_r in addition to rand - this is documented as a thread-safe, reentrant version of rand, but the “magic” behind it is simply that it takes a pointer to the current state instead of storing it in a static variable. Other random number functions, such as the drand48 family, seem to have versions with additional parameters, although I would need to read more to find out if it can be used to store state.
In any case, if you are "google" or "wikipedia" for a random number generator to realize yourself, making the "current state" an explicit parameter will be trivial.
source share