Commit 013044c3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

win32: do not clobber error status when touching thread variables

parent ab7d3c3c
......@@ -358,12 +358,21 @@ void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
int vlc_threadvar_set (vlc_threadvar_t key, void *value)
{
return TlsSetValue (key->id, value) ? ENOMEM : 0;
int saved = GetLastError ();
int val = TlsSetValue (key->id, value) ? ENOMEM : 0;
if (val == 0)
SetLastError(saved);
return val;
}
void *vlc_threadvar_get (vlc_threadvar_t key)
{
return TlsGetValue (key->id);
int saved = GetLastError ();
void *value = TlsGetValue (key->id);
SetLastError(saved);
return value;
}
/*** Threads ***/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment