Set the busy timeout for a database connection
#include <qdb/qdb.h> int qdb_setbusytimeout( qdb_hdt_t *db, int timeout );
qdb
This function sets the busy timeout for the database connection specified by db. 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 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 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 QDB_CONN_NONBLOCKING flag is affected by the timeout value. If you set or toggle QDB_CONN_NONBLOCKING, the busy timeout value is set to 0 or back to the -t value. Similarly, if you set the timeout to be QDB_TIMEOUT_NONBLOCK, the QDB_CONN_NONBLOCKING flag is set.
The QDB_CONN_NONBLOCKING flag bit can be set with qdb_connect() and toggled with qdb_parameters().
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |