Skip to content

Commit

Permalink
Fixing counting_semaphore::signal
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Apr 1, 2014
1 parent e603bdd commit d7caa30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hpx/lcos/local/counting_semaphore.hpp
Expand Up @@ -125,8 +125,9 @@ namespace hpx { namespace lcos { namespace local
template <typename Lock>
void signal_locked(boost::int64_t count, Lock& l)
{
// release no more threads than we get resources
value_ += count;
while (value_ >= 0)
for (boost::int64_t i = 0; value_ >= 0 && i < count; ++i)
{
if (!cond_.notify_one(l))
break;
Expand Down

0 comments on commit d7caa30

Please sign in to comment.