Browse Source

Work around compiler optimisation bug on FreeBSD by swapping two lines of code :-/

rdb 15 years ago
parent
commit
0e54f8b85b
1 changed files with 6 additions and 6 deletions
  1. 6 6
      panda/src/pipeline/asyncTaskBase.cxx

+ 6 - 6
panda/src/pipeline/asyncTaskBase.cxx

@@ -21,7 +21,7 @@ TypeHandle AsyncTaskBase::_type_handle;
 ////////////////////////////////////////////////////////////////////
 //     Function: AsyncTaskBase::Constructor
 //       Access: Protected
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 AsyncTaskBase::
 AsyncTaskBase() {
@@ -30,7 +30,7 @@ AsyncTaskBase() {
 ////////////////////////////////////////////////////////////////////
 //     Function: AsyncTaskBase::Destructor
 //       Access: Published, Virtual
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 AsyncTaskBase::
 ~AsyncTaskBase() {
@@ -48,14 +48,14 @@ record_task(Thread *current_thread) {
   nassertv(current_thread->_current_task == NULL);
 
   void *result = AtomicAdjust::compare_and_exchange_ptr
-    ((void * TVOLATILE &)current_thread->_current_task, 
+    ((void * TVOLATILE &)current_thread->_current_task,
      (void *)NULL, (void *)this);
 
   // If the return value is other than NULL, someone else must have
   // assigned the task first, in another thread.  That shouldn't be
   // possible.
-  nassertv(result == NULL);
   nassertv(current_thread->_current_task == this);
+  nassertv(result == NULL);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -69,12 +69,12 @@ clear_task(Thread *current_thread) {
   nassertv(current_thread->_current_task == this);
 
   void *result = AtomicAdjust::compare_and_exchange_ptr
-    ((void * TVOLATILE &)current_thread->_current_task, 
+    ((void * TVOLATILE &)current_thread->_current_task,
      (void *)this, (void *)NULL);
 
   // If the return value is other than this, someone else must have
   // assigned the task first, in another thread.  That shouldn't be
   // possible.
-  nassertv(result == this);
   nassertv(current_thread->_current_task == NULL);
+  nassertv(result == this);
 }