mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-08 07:55:35 +00:00
Bugfix
This commit is contained in:
parent
5e14310071
commit
e551e2bc5d
12 changed files with 107 additions and 37 deletions
|
|
@ -118,13 +118,20 @@ namespace sys_net
|
|||
be_t<s32> _h_errno;
|
||||
};
|
||||
|
||||
thread_local vm::var<_tls_data_t, vm::page_alloc_t> g_tls_net_data;
|
||||
// TODO
|
||||
thread_local vm::ptr<_tls_data_t> g_tls_net_data{};
|
||||
|
||||
inline void initialize_tls()
|
||||
{
|
||||
// allocate if not initialized
|
||||
if (!g_tls_net_data)
|
||||
{
|
||||
g_tls_net_data = { vm::main }; // allocate if not initialized
|
||||
g_tls_net_data.set(vm::alloc(sizeof(decltype(g_tls_net_data)::type), vm::main));
|
||||
|
||||
current_thread_register_atexit([addr = g_tls_net_data.addr()]
|
||||
{
|
||||
vm::dealloc_verbose_nothrow(addr, vm::main);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue