| Home | Libraries | People | FAQ | More

##### connection_pool::cancel

Stops any current outstanding operation and marks the pool as cancelled.

###### Synopsis

    void
    cancel();

###### Description

This function has the following effects:

- Stops the currently outstanding `async_run` operation, if any, which will complete with a success error code.
- Cancels any outstanding `async_get_connection` operations.
- Marks the pool as cancelled. Successive `async_get_connection` calls will fail immediately.

This function will return immediately, without waiting for the cancelled operations to complete.

You may call this function any number of times. Successive calls will have no effect.

###### Preconditions

`this->valid() == true`

###### Exception safety

Basic guarantee. Memory allocations and acquiring mutexes may throw.

###### Thread-safety

Reads the internal state handle. Mutates the pool state. If the pool was built with thread-safety enabled, it can be called concurrently with other functions that don't modify the state handle.