2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-12 12:02:54 +00:00

bounded-channel: high-watermark must be greater than zero

This commit is contained in:
Oliver Kowalke
2015-07-29 20:06:06 +02:00
parent a114a73de5
commit 6eaab69a76

View File

@@ -217,6 +217,10 @@ public:
throw invalid_argument( static_cast< int >( std::errc::invalid_argument),
"boost fiber: high-watermark is less than low-watermark for bounded_channel");
}
if ( 0 == hwm) {
throw invalid_argument( static_cast< int >( std::errc::invalid_argument),
"boost fiber: high-watermark is zero");
}
}
bounded_channel( std::size_t wm,
@@ -231,6 +235,10 @@ public:
not_full_cond_(),
hwm_( wm),
lwm_( wm) {
if ( 0 == wm) {
throw invalid_argument( static_cast< int >( std::errc::invalid_argument),
"boost fiber: watermark is zero");
}
}
bounded_channel( bounded_channel const&) = delete;