Fix TSS code, fix CV for Win32 platform
This commit is contained in:
@@ -56,7 +56,7 @@ static void **dataFetch(void)
|
|||||||
if (!result)
|
if (!result)
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
memset(result, 0, sizeof(sizeof(void *) * BH_MAX_TSS));
|
memset(result, 0, sizeof(void *) * BH_MAX_TSS);
|
||||||
if (pthread_setspecific(tssKey, result))
|
if (pthread_setspecific(tssKey, result))
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,13 @@ int BH_ConditionWaitFor(BH_Condition *condition,
|
|||||||
BH_Mutex *mutex,
|
BH_Mutex *mutex,
|
||||||
uint32_t timeout)
|
uint32_t timeout)
|
||||||
{
|
{
|
||||||
switch (SleepConditionVariableCS(&condition->handle, &mutex->handle, timeout))
|
if (SleepConditionVariableCS(&condition->handle, &mutex->handle, timeout))
|
||||||
|
return BH_OK;
|
||||||
|
|
||||||
|
switch (GetLastError())
|
||||||
{
|
{
|
||||||
case 0: return BH_ERROR;
|
|
||||||
case ERROR_TIMEOUT: return BH_TIMEOUT;
|
case ERROR_TIMEOUT: return BH_TIMEOUT;
|
||||||
default: return BH_OK;
|
default: return BH_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ static void __stdcall keyCleanup(void *data)
|
|||||||
/* Skip or remove TSS data */
|
/* Skip or remove TSS data */
|
||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return;
|
||||||
else if (FlsSetValue(tssKey, NULL))
|
else if (!FlsSetValue(tssKey, NULL))
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
/* Lock cleanup table and call cleanups */
|
/* Lock cleanup table and call cleanups */
|
||||||
@@ -58,8 +58,8 @@ static void **dataFetch(void)
|
|||||||
if (!result)
|
if (!result)
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
memset(result, 0, sizeof(sizeof(void *) * BH_MAX_TSS));
|
memset(result, 0, sizeof(void *) * BH_MAX_TSS);
|
||||||
if (FlsSetValue(tssKey, result))
|
if (!FlsSetValue(tssKey, result))
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user