mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -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);
|
||||
|
||||
void *ptr = AtomicAdjust::compare_and_exchange_ptr
|
||||
((void * TVOLATILE &)current_thread->_current_task,
|
||||
(void *)nullptr, (void *)this);
|
||||
(current_thread->_current_task, nullptr, (TypedReferenceCount *)this);
|
||||
|
||||
// If the return value is other than nullptr, someone else must have
|
||||
// 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);
|
||||
|
||||
ptr = AtomicAdjust::compare_and_exchange_ptr
|
||||
((void * TVOLATILE &)current_thread->_current_task,
|
||||
(void *)this, (void *)nullptr);
|
||||
(current_thread->_current_task, (TypedReferenceCount *)this, nullptr);
|
||||
|
||||
// If the return value is other than this, someone else must have assigned
|
||||
// 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
|
||||
* a task.
|
||||
*/
|
||||
INLINE AsyncTask *Thread::
|
||||
INLINE TypedReferenceCount *Thread::
|
||||
get_current_task() const {
|
||||
return _current_task;
|
||||
return (TypedReferenceCount *)_current_task;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,7 +89,7 @@ PUBLISHED:
|
||||
BLOCKING INLINE void join();
|
||||
INLINE void preempt();
|
||||
|
||||
INLINE AsyncTask *get_current_task() const;
|
||||
INLINE TypedReferenceCount *get_current_task() const;
|
||||
|
||||
INLINE void set_python_index(int index);
|
||||
|
||||
@ -142,7 +142,7 @@ private:
|
||||
int _pipeline_stage;
|
||||
PStatsCallback *_pstats_callback;
|
||||
bool _joinable;
|
||||
AsyncTask *_current_task;
|
||||
AtomicAdjust::Pointer _current_task;
|
||||
|
||||
int _python_index;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user