本文整理汇总了C++中DB_ENV::lock_detect方法的典型用法代码示例。如果您正苦于以下问题:C++ DB_ENV::lock_detect方法的具体用法?C++ DB_ENV::lock_detect怎么用?C++ DB_ENV::lock_detect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_ENV
的用法示例。
在下文中一共展示了DB_ENV::lock_detect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
static void *bdb_deadlock_detect_thread(void *arg){
DB_ENV *dbenv;
struct timeval t;
dbenv = arg;
while (!daemon_quit) {
t.tv_sec = 0;
t.tv_usec = bdb_settings.deadlock_detect_val;
(void)dbenv->lock_detect(dbenv, 0, DB_LOCK_YOUNGEST, NULL);
/* select is a more accurate sleep timer */
(void)select(0, NULL, NULL, NULL, &t);
}
return (NULL);
}
示例2: while
static void *bdb_dl_detect_thread(void *arg)
{
DB_ENV *dbenv;
struct timeval t;
dbenv = arg;
if (settings.verbose > 1) {
dbenv->errx(dbenv, "deadlock detecting thread created: %lu, every %d millisecond",
(u_long)pthread_self(), bdb_settings.dldetect_val);
}
while (!daemon_quit) {
t.tv_sec = 0;
t.tv_usec = bdb_settings.dldetect_val;
(void)dbenv->lock_detect(dbenv, 0, DB_LOCK_YOUNGEST, NULL);
/* select is a more accurate sleep timer */
(void)select(0, NULL, NULL, NULL, &t);
}
return (NULL);
}