diff --git a/panda/src/event/asyncTask.cxx b/panda/src/event/asyncTask.cxx index 17f0a0630d..9f70f0e5ad 100644 --- a/panda/src/event/asyncTask.cxx +++ b/panda/src/event/asyncTask.cxx @@ -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. diff --git a/panda/src/pipeline/thread.I b/panda/src/pipeline/thread.I index 12a8607e63..4fcd8a447e 100644 --- a/panda/src/pipeline/thread.I +++ b/panda/src/pipeline/thread.I @@ -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; } /** diff --git a/panda/src/pipeline/thread.h b/panda/src/pipeline/thread.h index 4dbebacc8b..b519aa75a6 100644 --- a/panda/src/pipeline/thread.h +++ b/panda/src/pipeline/thread.h @@ -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;