File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 2
2
// SPDX-License-Identifier: GPL-2.0-or-later
3
3
4
4
#include " common/alignment.h"
5
+ #include " common/elf_info.h"
5
6
#include " core/libraries/kernel/threads/pthread.h"
6
7
#include " thread.h"
7
8
@@ -63,13 +64,25 @@ NativeThread::NativeThread() : native_handle{0} {}
63
64
64
65
NativeThread::~NativeThread () {}
65
66
67
+ #ifndef _WIN64
68
+ void sleep_forever (void *) {
69
+ sleep (INT_MAX);
70
+ }
71
+ #endif
72
+
66
73
int NativeThread::Create (ThreadFunc func, void * arg, const ::Libraries::Kernel::PthreadAttr* attr) {
67
74
#ifndef _WIN64
68
75
pthread_t * pthr = reinterpret_cast <pthread_t *>(&native_handle);
69
76
pthread_attr_t pattr;
70
77
pthread_attr_init (&pattr);
71
78
pthread_attr_setstack (&pattr, attr->stackaddr_attr , attr->stacksize_attr );
72
- return pthread_create (pthr, &pattr, (PthreadFunc)func, arg);
79
+ const auto & elf_info = Common::ElfInfo::Instance ();
80
+ if (elf_info.Title ().contains (" Bloodborne" ) &&
81
+ ((Libraries::Kernel::Pthread*)arg)->name .contains (" Nexus" )) {
82
+ return pthread_create (pthr, &pattr, (PthreadFunc)sleep_forever, arg);
83
+ } else {
84
+ return pthread_create (pthr, &pattr, (PthreadFunc)func, arg);
85
+ }
73
86
#else
74
87
CLIENT_ID clientId{};
75
88
INITIAL_TEB teb{};
You can’t perform that action at this time.
0 commit comments