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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user