4 ms·
FWIW, my C++ toolkit library, KJ, does the same thing.[0] But presumably you could still write a condition predicate which looks at things which aren't actuall
by kentonv 3y ago
FWIW, my C++ toolkit library, KJ, does the same thing.[0]
But presumably you could still write a condition predicate which looks at things which aren't actually part of the mutex-wrapped structure? Or does is the Rust type system able to enforce that the callback can only consider the mutex-wrapped value and values that are constant over the lifetime of the wait? (You need the latter e.g. if you are waiting for the mutex-wrapped value to compare equal to some local variable...)
[0] https://github.com/capnproto/capnproto/blob/e6ad6f919aeb381b40d535b58dad96d97103333c/c++/src/kj/mutex.h#L415 https://github.com/capnproto/capnproto/blob/e6ad6f919aeb381b...