Commit Graph

5 Commits

Author SHA1 Message Date
Loic Dachary
64ded02c99 Relax Throttle::_reset_max conditions and associated unit tests
Removes a condition in Throttle::_reset_max by which the waiting queue is only
Signal()ed if the new maximum is lower than the current maximum.
There is no evidence of a use case where such a restriction would be
useful. In addition waking up a thread when the maximum increases
gives it a chance to immediately continue the suspended process
instead of waiting for the next put().

Create a new test file covering 100% of src/Throttle.{cc,h} lines of code.
The following methods are tested:

* Throttle::Throttle with and without a maximum
* Throttle::~Throttle when each pending Cond is deleted
* Throttle::take
* Throttle::get when updating the maximum ( lower or higher ),
  when going to sleep waiting for the count to lower under
  the maximum, when going to sleep because another thread is
  already asleep waiting
* Throttle::get_or_fail when there is no maximum,
  when requesting a count that is larger than the maximum, either
  when the current value is under the maximum or above the maximum.
* Throttle::wait when used to reset the maximum and wake up
  another thread asleep waiting

All asserts checking the arguments sanity are exercised ( negative argument
for Throttle::take etc. ).
Adds the LGPLv2+ licensing terms to COPYING along with the others.
Adds a Contributors section to the AUTHORS file.

Notes:
Testing asserts outputs verbose error messages that should be silenced
but it does not seem possible.

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-02-05 20:06:04 +01:00
Sage Weil
ed0653b493 COPYING: doc/ CC BY-SA
Signed-off-by: Sage Weil <sage@newdream.net>
2012-04-11 12:35:12 -07:00
Sage Weil
2677c72fde add libjson_spirit.la
This is lightweight and relies on boost spirit, which we already use, so
there are no new dependencies.

There were some other libraries that also looked good, but they weren't
already packages for existing Debian distros like squeeze or even wheezy.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-02-24 11:24:44 -08:00
Sage Weil
71131371de COPYING: note licenses for all files, not just the default
This (mostly) copies debian/copyright for now, but there are format
restrictions for that file.  Suggestions for a cleaner way to handle this
are welcome.  In the meantime, this is better...

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-01-12 10:03:27 -08:00
Sage Weil
7469f26a33 first pass at autoconf and automake 2008-01-27 20:45:29 -08:00