From de37a33633c96366216644a898b8c23fcd0f29a4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 20 Sep 2006 08:19:23 +0000 Subject: The public add_engine API now always places the new engine at the front of the list. The only time when the other behavior was desired was inside the load() function, which now simply appends to the engines vector itself. --- src/libstate.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/libstate.cpp') diff --git a/src/libstate.cpp b/src/libstate.cpp index a782f4c60..c9db23be8 100644 --- a/src/libstate.cpp +++ b/src/libstate.cpp @@ -242,14 +242,10 @@ Engine* Library_State::get_engine_n(u32bit n) const /************************************************* * Add a new engine to the list * *************************************************/ -void Library_State::add_engine(Engine* engine, bool in_front) +void Library_State::add_engine(Engine* engine) { Named_Mutex_Holder lock("engine"); - - if(in_front) - engines.insert(engines.begin(), engine); - else - engines.push_back(engine); + engines.insert(engines.begin(), engine); } /************************************************* @@ -320,9 +316,12 @@ void Library_State::load(Modules& modules) set_default_allocator(modules.default_allocator()); - std::vector engines = modules.engines(); - for(u32bit j = 0; j != engines.size(); ++j) - add_engine(engines[j], false); + std::vector mod_engines = modules.engines(); + for(u32bit j = 0; j != mod_engines.size(); ++j) + { + Named_Mutex_Holder lock("engine"); + engines.push_back(mod_engines[j]); + } std::vector sources = modules.entropy_sources(); for(u32bit j = 0; j != sources.size(); ++j) -- cgit v1.2.3