I'm trying out Windows support for Condition Variables today (as provided by Microsoft for Windows Vista and later). To initialize a condition variable, I call InitializeConditionVariable(), which is straightforward enough, but I don't see any way provided to destroy the condition variable when I'm done using it. Why is there no DeleteConditionVariable() function?
(I'd expect the API to be analogous to the existing CreateCriticalSection() / DestroyCriticalSection() API)
A conditional variable is a very light-weight object that is internally based on a single global kernel keyed event object that is always available through every process's entire lifetime. The conditional variable simply contains a pointer to that object. So there is nothing that needs to be freed explicitly, thus no delete function is needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With