DbEnv::mutex_set_increment()

#include <db_cxx.h>

int
DbEnv::mutex_set_increment(u_int32_t increment); 

Configure the number of additional mutexes to allocate.

If an application will allocate mutexes for its own use, the DbEnv::mutex_set_increment() method is used to add a number of mutexes to the default allocation.

Calling the DbEnv::mutex_set_increment() method discards any value previously set using the DbEnv::mutex_set_max() method.

The database environment's number of additional mutexes may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "mutex_set_increment", one or more whitespace characters, and the number of additional mutexes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DbEnv::mutex_set_increment() method configures a database environment, not only operations performed using the specified DbEnv handle.

The DbEnv::mutex_set_increment() method may not be called after the DbEnv::open() method is called. If the database environment already exists when DbEnv::open() is called, the information specified to DbEnv::mutex_set_increment() will be ignored.

The DbEnv::mutex_set_increment() method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters

increment

The increment parameter is the number of additional mutexes to allocate.

Errors

The DbEnv::mutex_set_increment() method may fail and throw a DbException exception, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

EINVAL

If the method was called after DbEnv::open() was called; or if an invalid flag value or parameter was specified.

Class

DbEnv

See Also

Mutex Methods