mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
Fixed thread pool a bit
Use 128-bit allocator instead of queue. When pool is full (128), threads just terminate as before.
This commit is contained in:
parent
e48f160a29
commit
ab365fe494
4 changed files with 134 additions and 59 deletions
|
@ -128,7 +128,7 @@ private:
|
|||
void notify_abort() noexcept;
|
||||
|
||||
// Called at the thread end, returns true if needs destruction
|
||||
bool finalize(thread_state result) noexcept;
|
||||
u64 finalize(thread_state result) noexcept;
|
||||
|
||||
// Cleanup after possibly deleting the thread instance
|
||||
static void finalize(u64 _self) noexcept;
|
||||
|
@ -286,21 +286,28 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
|
|||
static inline void* entry_point(void* arg)
|
||||
#endif
|
||||
{
|
||||
if (auto _this = thread_ctrl::get_current())
|
||||
{
|
||||
arg = _this;
|
||||
}
|
||||
|
||||
const auto _this = static_cast<named_thread*>(static_cast<thread*>(arg));
|
||||
|
||||
// Perform self-cleanup if necessary
|
||||
if (_this->entry_point())
|
||||
u64 _self = _this->entry_point();
|
||||
|
||||
if (!_self)
|
||||
{
|
||||
delete _this;
|
||||
thread::finalize(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
thread::finalize(_this->thread::m_thread);
|
||||
thread::finalize(_self);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool entry_point()
|
||||
u64 entry_point()
|
||||
{
|
||||
auto tls_error_cb = []()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue