Yeah, this doesn't currently use the “reusable” bit of EGL_KHR_reusable_sync.
It would seem to be clearer to either have this be an *actual* EGLSyncKHR proxy¹ or make it more obviously single-shot².
¹: so, take an EGLDisplay in the constructor, construct the EGLSyncKHR, and then the sync can be repeatedly raised/waited on without being destroyed. This would seem to eliminate the need for the locking, too.
²: raise() in the constructor, permanently invalidate after waiting-on.
Yeah, this doesn't currently use the “reusable” bit of EGL_KHR_ reusable_ sync.
It would seem to be clearer to either have this be an *actual* EGLSyncKHR proxy¹ or make it more obviously single-shot².
¹: so, take an EGLDisplay in the constructor, construct the EGLSyncKHR, and then the sync can be repeatedly raised/waited on without being destroyed. This would seem to eliminate the need for the locking, too.
²: raise() in the constructor, permanently invalidate after waiting-on.