mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
pipeline: fix regression with Thread.getCurrentTask() disappearing
This method was accidentally un-exposed by 2e20a0f16ed4c08030f978e46950ba635fca8a32 Fixes #226
This commit is contained in:
parent
dee4cd6201
commit
6a323081c0
@ -402,8 +402,7 @@ unlock_and_do_task() {
|
|||||||
nassertr(current_thread->_current_task == nullptr, DS_interrupt);
|
nassertr(current_thread->_current_task == nullptr, DS_interrupt);
|
||||||
|
|
||||||
void *ptr = AtomicAdjust::compare_and_exchange_ptr
|
void *ptr = AtomicAdjust::compare_and_exchange_ptr
|
||||||
((void * TVOLATILE &)current_thread->_current_task,
|
(current_thread->_current_task, nullptr, (TypedReferenceCount *)this);
|
||||||
(void *)nullptr, (void *)this);
|
|
||||||
|
|
||||||
// If the return value is other than nullptr, someone else must have
|
// If the return value is other than nullptr, someone else must have
|
||||||
// assigned the task first, in another thread. That shouldn't be possible.
|
// assigned the task first, in another thread. That shouldn't be possible.
|
||||||
@ -437,8 +436,7 @@ unlock_and_do_task() {
|
|||||||
nassertr(current_thread->_current_task == this, status);
|
nassertr(current_thread->_current_task == this, status);
|
||||||
|
|
||||||
ptr = AtomicAdjust::compare_and_exchange_ptr
|
ptr = AtomicAdjust::compare_and_exchange_ptr
|
||||||
((void * TVOLATILE &)current_thread->_current_task,
|
(current_thread->_current_task, (TypedReferenceCount *)this, nullptr);
|
||||||
(void *)this, (void *)nullptr);
|
|
||||||
|
|
||||||
// If the return value is other than this, someone else must have assigned
|
// If the return value is other than this, someone else must have assigned
|
||||||
// the task first, in another thread. That shouldn't be possible.
|
// the task first, in another thread. That shouldn't be possible.
|
||||||
|
@ -277,9 +277,9 @@ preempt() {
|
|||||||
* AsyncTaskManager), if any, or NULL if the thread is not currently servicing
|
* AsyncTaskManager), if any, or NULL if the thread is not currently servicing
|
||||||
* a task.
|
* a task.
|
||||||
*/
|
*/
|
||||||
INLINE AsyncTask *Thread::
|
INLINE TypedReferenceCount *Thread::
|
||||||
get_current_task() const {
|
get_current_task() const {
|
||||||
return _current_task;
|
return (TypedReferenceCount *)_current_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,7 +89,7 @@ PUBLISHED:
|
|||||||
BLOCKING INLINE void join();
|
BLOCKING INLINE void join();
|
||||||
INLINE void preempt();
|
INLINE void preempt();
|
||||||
|
|
||||||
INLINE AsyncTask *get_current_task() const;
|
INLINE TypedReferenceCount *get_current_task() const;
|
||||||
|
|
||||||
INLINE void set_python_index(int index);
|
INLINE void set_python_index(int index);
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ private:
|
|||||||
int _pipeline_stage;
|
int _pipeline_stage;
|
||||||
PStatsCallback *_pstats_callback;
|
PStatsCallback *_pstats_callback;
|
||||||
bool _joinable;
|
bool _joinable;
|
||||||
AsyncTask *_current_task;
|
AtomicAdjust::Pointer _current_task;
|
||||||
|
|
||||||
int _python_index;
|
int _python_index;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user