[Aptitude-svn-commit] r4243 - in branches/aptitude-0.3/aptitude: .
src/generic
Daniel Burrows
dburrows at costa.debian.org
Sat Sep 24 19:54:11 UTC 2005
Author: dburrows
Date: Sat Sep 24 19:54:08 2005
New Revision: 4243
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc
branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h
Log:
Replace the last use of out_of_solutions with solutions_exhausted, and
eliminate the variable.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Sat Sep 24 19:54:08 2005
@@ -1,5 +1,11 @@
2005-09-24 Daniel Burrows <dburrows at debian.org>
+ * src/generic/resolver_manager.cc, src/generic/resolver_manager.h:
+
+ Eliminate out_of_solutions; use the solutions_exhausted member
+ of the state snapshot to calculate
+ solution_generation_complete().
+
* src/generic/resolver_manager.cc:
Use the resolver counts instead of out_of_solutions to set the
Modified: branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc (original)
+++ branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc Sat Sep 24 19:54:08 2005
@@ -38,7 +38,6 @@
resolver(NULL),
undos(new undo_list),
selected_solution(0),
- out_of_solutions(false),
background_thread_killed(false),
resolver_null(true),
background_thread_suspend_count(0),
@@ -319,9 +318,6 @@
}
background_control_cond.wake_all();
}
-
- out_of_solutions.take();
- out_of_solutions.put(false);
}
void resolver_manager::create_resolver()
@@ -401,12 +397,7 @@
bool resolver_manager::solution_generation_complete() // const
{
- threads::mutex::lock l(mutex);
-
- bool rval = out_of_solutions.take();
- out_of_solutions.put(rval);
-
- return rval;
+ return state_snapshot().solutions_exhausted;
}
bool resolver_manager::solutions_at_start() const
@@ -483,20 +474,13 @@
sol_l.acquire();
solutions.push_back(new aptitude_resolver::solution(sol.clone()));
sol_l.release();
-
- out_of_solutions.take();
- out_of_solutions.put(false);
}
catch(NoMoreTime)
{
- out_of_solutions.take();
- out_of_solutions.put(false);
throw NoMoreTime();
}
catch(NoMoreSolutions)
{
- out_of_solutions.take();
- out_of_solutions.put(true);
throw NoMoreSolutions();
}
}
Modified: branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h (original)
+++ branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h Sat Sep 24 19:54:08 2005
@@ -180,14 +180,6 @@
/** The index of the currently selected solution. */
unsigned int selected_solution;
- /** If \b true, a find_next_solution() call will terminate with
- * NoMoreSolutions. (this may be the case even if it is \b false)
- *
- * By convention, this box is accessed while out_of_time is empty
- * if both are to be accessed at once.
- */
- threads::box<bool> out_of_solutions;
-
/** The pending job requests for the background thread.
*/
std::priority_queue<job_request, std::vector<job_request>,
@@ -384,7 +376,9 @@
int block_count,
background_continuation *k);
- /** If \b true, all solutions have been generated. */
+ /** If \b true, all solutions have been generated. This is equivalent
+ * to the solutions_exhausted member of the state snapshot.
+ */
bool solution_generation_complete() /*const*/;
/** If \b true, the solution pointer is set to the first
More information about the Aptitude-svn-commit
mailing list