/* * __sweep_server -- * The handle sweep server thread. */ static void * __sweep_server(void *arg) { WT_CONNECTION_IMPL *conn; WT_DECL_RET; WT_SESSION_IMPL *session; session = arg; conn = S2C(session); /* * Sweep for dead handles. */ while (F_ISSET(conn, WT_CONN_SERVER_RUN) && F_ISSET(conn, WT_CONN_SERVER_SWEEP)) { /* Wait until the next event. */ WT_ERR_TIMEDOUT_OK( __wt_cond_wait(session, conn->sweep_cond, 30 * WT_MILLION)); /* Sweep the handles. */ WT_ERR(__sweep(session)); } if (0) { err: __wt_err(session, ret, "handle sweep server error"); } return (NULL); }
void dm_deferred_entry_dec(struct dm_deferred_entry *entry, struct list_head *head) { unsigned long flags; spin_lock_irqsave(&entry->ds->lock, flags); BUG_ON(!entry->count); --entry->count; __sweep(entry->ds, head); spin_unlock_irqrestore(&entry->ds->lock, flags); }