mirror of
https://github.com/RPCS3/common.git
synced 2024-11-26 20:50:26 +00:00
SleepQueue: sleep_entry_t don't extends std::enable_shared_from_this<sleep_entry_t> anymore
This commit is contained in:
parent
d2619e94ec
commit
8807d85677
@ -2,12 +2,17 @@
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
|
||||
struct sleep_entry_t : protected std::enable_shared_from_this<sleep_entry_t>
|
||||
struct sleep_entry_t
|
||||
{
|
||||
virtual void sleep() = 0;
|
||||
virtual void awake() = 0;
|
||||
virtual std::shared_ptr<sleep_entry_t> shared_sleep_entry() = 0;
|
||||
|
||||
friend class sleep_queue_entry_t;
|
||||
template<typename Type>
|
||||
std::shared_ptr<Type> as_shared_ptr()
|
||||
{
|
||||
return std::static_pointer_cast<Type>(shared_sleep_entry());
|
||||
}
|
||||
};
|
||||
|
||||
using sleep_queue_t = std::deque<std::shared_ptr<sleep_entry_t>>;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
void sleep_queue_entry_t::add_entry()
|
||||
{
|
||||
m_queue.emplace_back(std::static_pointer_cast<sleep_entry_t>(m_thread.shared_from_this()));
|
||||
m_queue.emplace_back(m_thread.shared_sleep_entry());
|
||||
}
|
||||
|
||||
void sleep_queue_entry_t::remove_entry()
|
||||
|
Loading…
Reference in New Issue
Block a user