本文整理汇总了C++中UT_LIST_GET_NEXT函数的典型用法代码示例。如果您正苦于以下问题:C++ UT_LIST_GET_NEXT函数的具体用法?C++ UT_LIST_GET_NEXT怎么用?C++ UT_LIST_GET_NEXT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UT_LIST_GET_NEXT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sym_tab_free_private
/******************************************************************//**
Frees the memory allocated dynamically AFTER parsing phase for variables
etc. in the symbol table. Does not free the mem heap where the table was
originally created. Frees also SQL explicit cursor definitions. */
UNIV_INTERN
void
sym_tab_free_private(
/*=================*/
sym_tab_t* sym_tab) /*!< in, own: symbol table */
{
sym_node_t* sym;
func_node_t* func;
sym = UT_LIST_GET_FIRST(sym_tab->sym_list);
while (sym) {
eval_node_free_val_buf(sym);
if (sym->prefetch_buf) {
sel_col_prefetch_buf_free(sym->prefetch_buf);
}
if (sym->cursor_def) {
que_graph_free_recursive(sym->cursor_def);
}
sym = UT_LIST_GET_NEXT(sym_list, sym);
}
func = UT_LIST_GET_FIRST(sym_tab->func_node_list);
while (func) {
eval_node_free_val_buf(func);
func = UT_LIST_GET_NEXT(func_node_list, func);
}
}
示例2: rw_lock_free_func
/******************************************************************//**
Calling this function is obligatory only if the memory buffer containing
the rw-lock is freed. Removes an rw-lock object from the global list. The
rw-lock is checked to be in the non-locked state. */
UNIV_INTERN
void
rw_lock_free_func(
/*==============*/
rw_lock_t* lock) /*!< in: rw-lock */
{
ut_ad(rw_lock_validate(lock));
ut_a(lock->lock_word == X_LOCK_DECR);
#ifndef INNODB_RW_LOCKS_USE_ATOMICS
mutex_free(rw_lock_get_mutex(lock));
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
mutex_enter(&rw_lock_list_mutex);
os_event_free(lock->event);
os_event_free(lock->wait_ex_event);
ut_ad(UT_LIST_GET_PREV(list, lock) == NULL
|| UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
ut_ad(UT_LIST_GET_NEXT(list, lock) == NULL
|| UT_LIST_GET_NEXT(list, lock)->magic_n == RW_LOCK_MAGIC_N);
UT_LIST_REMOVE(list, rw_lock_list, lock);
mutex_exit(&rw_lock_list_mutex);
ut_d(lock->magic_n = 0);
}
示例3: trx_roll_savepoints_free
/*******************************************************************//**
Frees savepoint structs starting from savep, if savep == NULL then
free all savepoints. */
UNIV_INTERN
void
trx_roll_savepoints_free(
/*=====================*/
trx_t* trx, /*!< in: transaction handle */
trx_named_savept_t* savep) /*!< in: free all savepoints > this one;
if this is NULL, free all savepoints
of trx */
{
trx_named_savept_t* next_savep;
if (savep == NULL) {
savep = UT_LIST_GET_FIRST(trx->trx_savepoints);
} else {
savep = UT_LIST_GET_NEXT(trx_savepoints, savep);
}
while (savep != NULL) {
next_savep = UT_LIST_GET_NEXT(trx_savepoints, savep);
trx_roll_savepoint_free(trx, savep);
savep = next_savep;
}
}
示例4: rw_lock_free
void
rw_lock_free(
/*=========*/
rw_lock_t* lock) /* in: rw-lock */
{
ut_ad(rw_lock_validate(lock));
ut_a(rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED);
ut_a(rw_lock_get_waiters(lock) == 0);
ut_a(rw_lock_get_reader_count(lock) == 0);
lock->magic_n = 0;
mutex_free(rw_lock_get_mutex(lock));
mutex_enter(&rw_lock_list_mutex);
os_event_free(lock->event);
#ifdef __WIN__
os_event_free(lock->wait_ex_event);
#endif
if (UT_LIST_GET_PREV(list, lock)) {
ut_a(UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
}
if (UT_LIST_GET_NEXT(list, lock)) {
ut_a(UT_LIST_GET_NEXT(list, lock)->magic_n == RW_LOCK_MAGIC_N);
}
UT_LIST_REMOVE(list, rw_lock_list, lock);
mutex_exit(&rw_lock_list_mutex);
}
示例5: rw_lock_list_print_info
/***************************************************************//**
Prints debug info of currently locked rw-locks. */
UNIV_INTERN
void
rw_lock_list_print_info(
/*====================*/
FILE* file) /*!< in: file where to print */
{
rw_lock_t* lock;
ulint count = 0;
rw_lock_debug_t* info;
mutex_enter(&rw_lock_list_mutex);
fputs("-------------\n"
"RW-LATCH INFO\n"
"-------------\n", file);
lock = UT_LIST_GET_FIRST(rw_lock_list);
while (lock != NULL) {
count++;
#ifndef INNODB_RW_LOCKS_USE_ATOMICS
mutex_enter(&(lock->mutex));
#endif
if (lock->lock_word != X_LOCK_DECR) {
fprintf(file, "RW-LOCK: %p ", (void*) lock);
if (rw_lock_get_waiters(lock)) {
fputs(" Waiters for the lock exist\n", file);
} else {
putc('\n', file);
}
rw_lock_debug_mutex_enter();
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
rw_lock_debug_print(file, info);
info = UT_LIST_GET_NEXT(list, info);
}
rw_lock_debug_mutex_exit();
}
#ifndef INNODB_RW_LOCKS_USE_ATOMICS
mutex_exit(&(lock->mutex));
#endif
lock = UT_LIST_GET_NEXT(list, lock);
}
fprintf(file, "Total number of rw-locks %ld\n", count);
mutex_exit(&rw_lock_list_mutex);
}
示例6: mutex_free
/******************************************************************//**
Calling this function is obligatory only if the memory buffer containing
the mutex is freed. Removes a mutex object from the mutex list. The mutex
is checked to be in the reset state. */
UNIV_INTERN
void
mutex_free(
/*=======*/
mutex_t* mutex) /*!< in: mutex */
{
ut_ad(mutex_validate(mutex));
ut_a(mutex_get_lock_word(mutex) == 0);
ut_a(mutex_get_waiters(mutex) == 0);
#ifdef UNIV_MEM_DEBUG
if (mutex == &mem_hash_mutex) {
ut_ad(UT_LIST_GET_LEN(mutex_list) == 1);
ut_ad(UT_LIST_GET_FIRST(mutex_list) == &mem_hash_mutex);
UT_LIST_REMOVE(list, mutex_list, mutex);
goto func_exit;
}
#endif /* UNIV_MEM_DEBUG */
if (mutex != &mutex_list_mutex
#ifdef UNIV_SYNC_DEBUG
&& mutex != &sync_thread_mutex
#endif /* UNIV_SYNC_DEBUG */
) {
mutex_enter(&mutex_list_mutex);
ut_ad(!UT_LIST_GET_PREV(list, mutex)
|| UT_LIST_GET_PREV(list, mutex)->magic_n
== MUTEX_MAGIC_N);
ut_ad(!UT_LIST_GET_NEXT(list, mutex)
|| UT_LIST_GET_NEXT(list, mutex)->magic_n
== MUTEX_MAGIC_N);
UT_LIST_REMOVE(list, mutex_list, mutex);
mutex_exit(&mutex_list_mutex);
}
os_event_free(mutex->event);
#ifdef UNIV_MEM_DEBUG
func_exit:
#endif /* UNIV_MEM_DEBUG */
#if !defined(HAVE_ATOMIC_BUILTINS)
os_fast_mutex_free(&(mutex->os_fast_mutex));
#endif
/* If we free the mutex protecting the mutex list (freeing is
not necessary), we have to reset the magic number AFTER removing
it from the list. */
#ifdef UNIV_DEBUG
mutex->magic_n = 0;
#endif /* UNIV_DEBUG */
}
示例7: rw_lock_list_print_info
void
rw_lock_list_print_info(void)
/*=========================*/
{
#ifndef UNIV_SYNC_DEBUG
#else
rw_lock_t* lock;
ulint count = 0;
rw_lock_debug_t* info;
mutex_enter(&rw_lock_list_mutex);
printf("-------------\n");
printf("RW-LATCH INFO\n");
printf("-------------\n");
lock = UT_LIST_GET_FIRST(rw_lock_list);
while (lock != NULL) {
count++;
mutex_enter(&(lock->mutex));
if ((rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED)
|| (rw_lock_get_reader_count(lock) != 0)
|| (rw_lock_get_waiters(lock) != 0)) {
printf("RW-LOCK: %lx ", (ulint)lock);
if (rw_lock_get_waiters(lock)) {
printf(" Waiters for the lock exist\n");
} else {
printf("\n");
}
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
rw_lock_debug_print(info);
info = UT_LIST_GET_NEXT(list, info);
}
}
mutex_exit(&(lock->mutex));
lock = UT_LIST_GET_NEXT(list, lock);
}
printf("Total number of rw-locks %ld\n", count);
mutex_exit(&rw_lock_list_mutex);
#endif
}
示例8: rw_lock_list_print_info
void
rw_lock_list_print_info(
/*====================*/
FILE* file) /* in: file where to print */
{
rw_lock_t* lock;
ulint count = 0;
rw_lock_debug_t* info;
mutex_enter(&rw_lock_list_mutex);
fputs("-------------\n"
"RW-LATCH INFO\n"
"-------------\n", file);
lock = UT_LIST_GET_FIRST(rw_lock_list);
while (lock != NULL) {
count++;
mutex_enter(&(lock->mutex));
if ((rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED)
|| (rw_lock_get_reader_count(lock) != 0)
|| (rw_lock_get_waiters(lock) != 0)) {
fprintf(file, "RW-LOCK: %p ", (void*) lock);
if (rw_lock_get_waiters(lock)) {
fputs(" Waiters for the lock exist\n", file);
} else {
putc('\n', file);
}
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
rw_lock_debug_print(info);
info = UT_LIST_GET_NEXT(list, info);
}
}
mutex_exit(&(lock->mutex));
lock = UT_LIST_GET_NEXT(list, lock);
}
fprintf(file, "Total number of rw-locks %ld\n", count);
mutex_exit(&rw_lock_list_mutex);
}
示例9: buf_flush_insert_sorted_into_flush_list
void
buf_flush_insert_sorted_into_flush_list(
/*====================================*/
buf_block_t* block) /* in: block which is modified */
{
buf_block_t* prev_b;
buf_block_t* b;
ut_ad(mutex_own(&(buf_pool->mutex)));
prev_b = NULL;
b = UT_LIST_GET_FIRST(buf_pool->flush_list);
while (b && (ut_dulint_cmp(b->oldest_modification,
block->oldest_modification) > 0)) {
prev_b = b;
b = UT_LIST_GET_NEXT(flush_list, b);
}
if (prev_b == NULL) {
UT_LIST_ADD_FIRST(flush_list, buf_pool->flush_list, block);
} else {
UT_LIST_INSERT_AFTER(flush_list, buf_pool->flush_list, prev_b,
block);
}
ut_ad(buf_flush_validate_low());
}
示例10: buf_flush_validate_low
/**********************************************************************
Validates the flush list. */
static
ibool
buf_flush_validate_low(void)
/*========================*/
/* out: TRUE if ok */
{
buf_block_t* block;
dulint om;
UT_LIST_VALIDATE(flush_list, buf_block_t, buf_pool->flush_list);
block = UT_LIST_GET_FIRST(buf_pool->flush_list);
while (block != NULL) {
om = block->oldest_modification;
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
ut_a(ut_dulint_cmp(om, ut_dulint_zero) > 0);
block = UT_LIST_GET_NEXT(flush_list, block);
if (block) {
ut_a(ut_dulint_cmp(om, block->oldest_modification)
>= 0);
}
}
return(TRUE);
}
示例11: TRACE
void OSEventThread::processTimeouts()
{
TRACE("~~~~ +processTimeouts ~~~~\n");
ULONG now = OS::GetTickCount();
OSMutexLocker _locker(&mMutex);
event_timer_t * tev = UT_LIST_GET_FIRST(mTimerList);
event_timer_t * next;
// walk list, see if now >= ev->timeout for any events
TRACE("~~~~ Looking for timers <= %lu ~~~~\n", (unsigned long)now);
while ((tev) && (now > tev->timeout)) {
// Timer expired
TRACE("~~~~ firing timer ~~~~\n");
next = UT_LIST_GET_NEXT(watchNode,tev);
tev->status = 1;
UT_LIST_ADD_FIRST(activeNode,mTimeoutList,tev);
if (tev->persist == false){
UT_LIST_REMOVE(watchNode,mTimerList,tev);
//if(tev != &mIdleTimer)
DecreaseWatchNum();
}
tev = next;
}
TRACE("~~~~ -processTimeouts ~~~~\n");
}
示例12: buf_LRU_old_init
/***********************************************************************
Initializes the old blocks pointer in the LRU list. This function should be
called when the LRU list grows to BUF_LRU_OLD_MIN_LEN length. */
static
void
buf_LRU_old_init(void)
/*==================*/
{
buf_block_t* block;
ut_ad(mutex_own(&(buf_pool->mutex)));
ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == BUF_LRU_OLD_MIN_LEN);
/* We first initialize all blocks in the LRU list as old and then use
the adjust function to move the LRU_old pointer to the right
position */
block = UT_LIST_GET_FIRST(buf_pool->LRU);
while (block != NULL) {
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
ut_a(block->in_LRU_list);
block->old = TRUE;
block = UT_LIST_GET_NEXT(LRU, block);
}
buf_pool->LRU_old = UT_LIST_GET_FIRST(buf_pool->LRU);
buf_pool->LRU_old_len = UT_LIST_GET_LEN(buf_pool->LRU);
buf_LRU_old_adjust_len();
}
示例13: trx_list_insert_ordered
/****************************************************************//**
Inserts the trx handle in the trx system trx list in the right position.
The list is sorted on the trx id so that the biggest id is at the list
start. This function is used at the database startup to insert incomplete
transactions to the list. */
static
void
trx_list_insert_ordered(
/*====================*/
trx_t* trx) /*!< in: trx handle */
{
trx_t* trx2;
ut_ad(mutex_own(&kernel_mutex));
trx2 = UT_LIST_GET_FIRST(trx_sys->trx_list);
while (trx2 != NULL) {
if (ut_dulint_cmp(trx->id, trx2->id) >= 0) {
ut_ad(ut_dulint_cmp(trx->id, trx2->id) == 1);
break;
}
trx2 = UT_LIST_GET_NEXT(trx_list, trx2);
}
if (trx2 != NULL) {
trx2 = UT_LIST_GET_PREV(trx_list, trx2);
if (trx2 == NULL) {
UT_LIST_ADD_FIRST(trx_list, trx_sys->trx_list, trx);
} else {
UT_LIST_INSERT_AFTER(trx_list, trx_sys->trx_list,
trx2, trx);
}
} else {
UT_LIST_ADD_LAST(trx_list, trx_sys->trx_list, trx);
}
}
示例14: rw_lock_own
ibool
rw_lock_own(
/*========*/
/* out: TRUE if locked */
rw_lock_t* lock, /* in: rw-lock */
ulint lock_type) /* in: lock type: RW_LOCK_SHARED,
RW_LOCK_EX */
{
rw_lock_debug_t* info;
ut_ad(lock);
ut_ad(rw_lock_validate(lock));
mutex_enter(&(lock->mutex));
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
if (os_thread_eq(info->thread_id, os_thread_get_curr_id())
&& (info->pass == 0)
&& (info->lock_type == lock_type)) {
mutex_exit(&(lock->mutex));
/* Found! */
return(TRUE);
}
info = UT_LIST_GET_NEXT(list, info);
}
mutex_exit(&(lock->mutex));
return(FALSE);
}
示例15: rw_lock_print
void
rw_lock_print(
/*==========*/
rw_lock_t* lock) /* in: rw-lock */
{
#ifndef UNIV_SYNC_DEBUG
printf(
"Sorry, cannot give rw-lock info in non-debug version!\n");
#else
ulint count = 0;
rw_lock_debug_t* info;
printf("-------------\n");
printf("RW-LATCH INFO\n");
printf("RW-LATCH: %lx ", (ulint)lock);
if ((rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED)
|| (rw_lock_get_reader_count(lock) != 0)
|| (rw_lock_get_waiters(lock) != 0)) {
if (rw_lock_get_waiters(lock)) {
printf(" Waiters for the lock exist\n");
} else {
printf("\n");
}
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
rw_lock_debug_print(info);
info = UT_LIST_GET_NEXT(list, info);
}
}
#endif
}