Sets the maximum count of items retained by the queue.
By default, the maximum count of items is unlimited.
This method is thread-safe.