xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_busy_timeout.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_BUSY_TIMEOUT 3
3.Os
4.Sh NAME
5.Nm sqlite3_busy_timeout
6.Nd set a busy timeout
7.Sh SYNOPSIS
8.In sqlite3.h
9.Ft int
10.Fo sqlite3_busy_timeout
11.Fa "sqlite3*"
12.Fa "int ms"
13.Fc
14.Sh DESCRIPTION
15This routine sets a busy handler that sleeps for a specified
16amount of time when a table is locked.
17The handler will sleep multiple times until at least "ms" milliseconds
18of sleeping have accumulated.
19After at least "ms" milliseconds of sleeping, the handler returns 0
20which causes
21.Fn sqlite3_step
22to return SQLITE_BUSY.
23.Pp
24Calling this routine with an argument less than or equal to zero turns
25off all busy handlers.
26.Pp
27There can only be a single busy handler for a particular database connection
28at any given moment.
29If another busy handler was defined  (using
30.Fn sqlite3_busy_handler )
31prior to calling this routine, that other busy handler is cleared.
32.Pp
33.Sh IMPLEMENTATION NOTES
34These declarations were extracted from the
35interface documentation at line 2842.
36.Bd -literal
37SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
38.Ed
39.Sh SEE ALSO
40.Xr sqlite3 3 ,
41.Xr sqlite3_busy_handler 3 ,
42.Xr sqlite3_step 3 ,
43.Xr SQLITE_OK 3
44