mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-06 00:11:09 +08:00
producer_consumer.cc: Use linear algorithm for producer.
2004-03-24 Felix Yen <fwy@alumni.brown.edu> * testsuite/performance/20_util/allocator/producer_consumer.cc: Use linear algorithm for producer. From-SVN: r79920
This commit is contained in:
parent
b5472e1d48
commit
b4a76c01db
@ -1,3 +1,8 @@
|
||||
2004-03-24 Felix Yen <fwy@alumni.brown.edu>
|
||||
|
||||
* testsuite/performance/20_util/allocator/producer_consumer.cc:
|
||||
Use linear algorithm for producer.
|
||||
|
||||
2004-03-24 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/ext/mt_allocator.h (__mt_alloc<>::allocate,
|
||||
|
@ -129,8 +129,9 @@ template<typename Container>
|
||||
Queue<Container>::push_back(const typename Container::value_type& value)
|
||||
{
|
||||
AutoLock auto_lock(lock);
|
||||
const bool signal = queue.empty();
|
||||
queue.insert(queue.end(), value);
|
||||
if (queue.size() == 1) pthread_cond_signal(&condition);
|
||||
if (signal) pthread_cond_signal(&condition);
|
||||
}
|
||||
|
||||
template<typename Container>
|
||||
|
Loading…
Reference in New Issue
Block a user