Changeset 1182

Show
Ignore:
Timestamp:
06/13/09 04:10:41 (4 years ago)
Author:
gabriel@…
Message:

Move the lock in the logger thread.

When erasing all-but-the-last element in the list, there's
no need to lock the mutex since there's only one thread
that is removing elements.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/jack_zombies/libs/hydrogen/src/object.cpp

    r1181 r1182  
    213213                        } 
    214214                } 
     215                queue.erase( queue.begin(), last ); 
    215216                pthread_mutex_lock( &pLogger->__mutex ); 
    216                 queue.erase( queue.begin(), last ); 
    217217                if( ! queue.empty() ) queue.pop_front(); 
    218218                pthread_mutex_unlock( &pLogger->__mutex );