Skip to content

Commit

Permalink
Merge pull request #2 from dotnwat/rwlock-timeout-fix
Browse files Browse the repository at this point in the history
rwlock: pass timeout parameter to get_units
  • Loading branch information
dotnwat committed Jan 20, 2021
2 parents 9569235 + f21ee08 commit c3d4862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/seastar/core/rwlock.hh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public:
/// return an exceptional future) when it failed to obtain the lock -
/// e.g., on allocation failure.
future<holder> hold_read_lock(typename semaphore_type::time_point timeout = semaphore_type::time_point::max()) {
return get_units(_sem, 1);
return get_units(_sem, 1, timeout);
}

/// hold_write_lock() waits for a write lock and returns an object which,
Expand All @@ -161,7 +161,7 @@ public:
/// return an exceptional future) when it failed to obtain the lock -
/// e.g., on allocation failure.
future<holder> hold_write_lock(typename semaphore_type::time_point timeout = semaphore_type::time_point::max()) {
return get_units(_sem, max_ops);
return get_units(_sem, max_ops, timeout);
}

/// Checks if any read or write locks are currently held.
Expand Down

0 comments on commit c3d4862

Please sign in to comment.