Set the busy timeout for a database connection
#include <qdb/qdb.h> int qdb_setbusytimeout( qdb_hdt_t *db, int timeout );
This function sets the busy timeout for the specified database connection. The initial value can be specified on the qdb command line with the -t option; by default, it's 5000 ms. Specifying a value of 0 is the same as setting QDB_TIMEOUT_NONBLOCK.
The busy timeout is the amount of time that a client can attempt to access a database before it returns EBUSY. If two clients attempt to write to the same database, the database is locked while the first client is writing and the second client's attempt will fail if the busy timeout period expires.
The timeout value is affected by the QDB_CONN_NONBLOCKING flag. If you enable this flag, the timeout is set to 0 or back to the -t value. Similarly, if you set the timeout to QDB_TIMEOUT_NONBLOCK, the flag is enabled.
The QDB_CONN_NONBLOCKING flag can be set with qdb_connect() and toggled with qdb_parameters().
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |