glow icon indicating copy to clipboard operation
glow copied to clipboard

`raw_debug_message_callback` might be called from multiple threads at once

Open Imberflur opened this issue 1 year ago • 0 comments

Right now it creates a mutable reference to the user data which requires exclusivity.

But https://www.khronos.org/opengl/wiki/Debug_Output#Getting_messages notes:

The callback can be called synchronously or asynchronously. This is controlled by the glEnable flag GL_DEBUG_OUTPUT_SYNCHRONOUS. If this flag is enabled, then OpenGL guarantees that your callback will be called: ... ... If the flag is disabled, then none of these are guaranteed. So if you want asynchronous debug output (for performance reasons), you must take into account the following possibilities: ... Multiple instances of the same callback function may be called at the same time, obviously from different threads.

Imberflur avatar May 03 '24 05:05 Imberflur