You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the value of the at the errorslot is set to the local allocation before the mutex is set. If I understand it correctly, the slot should be locked by the mutex. Was this just a confusion on my part? I would have expected something like:
instead. If this is intentional, maybe a comment here would also help other people trying to understand and/or refactor the GLFW code for their own needs.
With regards,
Hypatia of Sva.
The text was updated successfully, but these errors were encountered:
_glfwPlatformSetTls sets a value that is in the thread local storage (that's what Tls stands for). So each thread has its own and no locking is needed.
The code within the mutex section is collecting the _GLFWerror structs from all threads together in a global linked list (so they can be freed later without relying on each thread), so it needs to to be properly synchronized.
Hello GLFW team,
I was looking through the code of GLFW 3.4 and was a bit confused by the following lines in
_glfwInputError
ininit.c
:It seems like the value of the at the errorslot is set to the local allocation before the mutex is set. If I understand it correctly, the slot should be locked by the mutex. Was this just a confusion on my part? I would have expected something like:
instead. If this is intentional, maybe a comment here would also help other people trying to understand and/or refactor the GLFW code for their own needs.
With regards,
Hypatia of Sva.
The text was updated successfully, but these errors were encountered: