Fixed TLS for PPU threads

This commit is contained in:
Nekotekina 2015-01-30 23:01:13 +03:00
parent 2be045593a
commit 4ea1b8cffc
4 changed files with 72 additions and 3 deletions

View file

@ -18,6 +18,8 @@ namespace sce_libc_func
{
sceLibc.Error("__cxa_atexit(func=0x%x, arg=0x%x, dso=0x%x)", func, arg, dso);
LV2_LOCK(0);
g_atexit.insert(g_atexit.begin(), [func, arg, dso](ARMv7Context& context)
{
func(context, arg);
@ -28,6 +30,8 @@ namespace sce_libc_func
{
sceLibc.Error("__aeabi_atexit(arg=0x%x, func=0x%x, dso=0x%x)", arg, func, dso);
LV2_LOCK(0);
g_atexit.insert(g_atexit.begin(), [func, arg, dso](ARMv7Context& context)
{
func(context, arg);
@ -38,6 +42,8 @@ namespace sce_libc_func
{
sceLibc.Error("exit()");
LV2_LOCK(0);
for (auto func : g_atexit)
{
func(context);