That’s a really interesting question, and one I thank you for raising. We may have overlooked something here in that without a VG context to validate a handle against, it’s difficult to know which context(s) it belongs to. I’m going to take this one off to the VG working group.
So far I’ve “solved” the problem by using the upper 6 bits of my handle to identify the openvg context it belongs to. I can now have up to 64 contexts running on a system before this counter overflows and I run into the risk of a context/image/thread mismatch.
It’s a dirty hack that solves the problem for most applications (e.g. those who never create more than 64 contexts).
Somehow I have the feeling I’m the first one who implements OpenVG/EGL with all these features on a multithreading environment