Commit d67cc23e authored by marko's avatar marko

branches/zip: sync_thread_add_level(): Reduce code duplication in

the sync_thread_levels_g() check, so that it will be easier to add
new sync levels.
parent 9e86928b
......@@ -1016,62 +1016,48 @@ sync_thread_add_level(
/* Do no order checking */
break;
case SYNC_MEM_POOL:
ut_a(sync_thread_levels_g(array, SYNC_MEM_POOL));
break;
case SYNC_MEM_HASH:
ut_a(sync_thread_levels_g(array, SYNC_MEM_HASH));
break;
case SYNC_RECV:
ut_a(sync_thread_levels_g(array, SYNC_RECV));
break;
case SYNC_WORK_QUEUE:
ut_a(sync_thread_levels_g(array, SYNC_WORK_QUEUE));
break;
case SYNC_LOG:
ut_a(sync_thread_levels_g(array, SYNC_LOG));
break;
case SYNC_THR_LOCAL:
ut_a(sync_thread_levels_g(array, SYNC_THR_LOCAL));
break;
case SYNC_ANY_LATCH:
ut_a(sync_thread_levels_g(array, SYNC_ANY_LATCH));
break;
case SYNC_TRX_SYS_HEADER:
ut_a(sync_thread_levels_g(array, SYNC_TRX_SYS_HEADER));
break;
case SYNC_DOUBLEWRITE:
ut_a(sync_thread_levels_g(array, SYNC_DOUBLEWRITE));
case SYNC_BUF_POOL:
case SYNC_SEARCH_SYS:
case SYNC_TRX_LOCK_HEAP:
case SYNC_KERNEL:
case SYNC_IBUF_BITMAP_MUTEX:
case SYNC_RSEG:
case SYNC_TRX_UNDO:
case SYNC_PURGE_LATCH:
case SYNC_PURGE_SYS:
case SYNC_DICT_AUTOINC_MUTEX:
case SYNC_DICT_OPERATION:
case SYNC_DICT_HEADER:
if (!sync_thread_levels_g(array, level)) {
fprintf(stderr,
"InnoDB: sync_thread_levels_g(array, %lu)"
"does not hold!\n", level);
ut_error;
}
break;
case SYNC_BUF_BLOCK:
ut_a((sync_thread_levels_contain(array, SYNC_BUF_POOL)
&& sync_thread_levels_g(array, SYNC_BUF_BLOCK - 1))
|| sync_thread_levels_g(array, SYNC_BUF_BLOCK));
break;
case SYNC_BUF_POOL:
ut_a(sync_thread_levels_g(array, SYNC_BUF_POOL));
break;
case SYNC_SEARCH_SYS:
ut_a(sync_thread_levels_g(array, SYNC_SEARCH_SYS));
break;
case SYNC_TRX_LOCK_HEAP:
ut_a(sync_thread_levels_g(array, SYNC_TRX_LOCK_HEAP));
break;
case SYNC_REC_LOCK:
ut_a((sync_thread_levels_contain(array, SYNC_KERNEL)
&& sync_thread_levels_g(array, SYNC_REC_LOCK - 1))
|| sync_thread_levels_g(array, SYNC_REC_LOCK));
break;
case SYNC_KERNEL:
ut_a(sync_thread_levels_g(array, SYNC_KERNEL));
break;
case SYNC_IBUF_BITMAP:
ut_a((sync_thread_levels_contain(array, SYNC_IBUF_BITMAP_MUTEX)
&& sync_thread_levels_g(array, SYNC_IBUF_BITMAP - 1))
|| sync_thread_levels_g(array, SYNC_IBUF_BITMAP));
break;
case SYNC_IBUF_BITMAP_MUTEX:
ut_a(sync_thread_levels_g(array, SYNC_IBUF_BITMAP_MUTEX));
break;
case SYNC_FSP_PAGE:
ut_a(sync_thread_levels_contain(array, SYNC_FSP));
break;
......@@ -1092,18 +1078,6 @@ sync_thread_add_level(
ut_a(sync_thread_levels_contain(array, SYNC_KERNEL)
&& sync_thread_levels_contain(array, SYNC_FSP_PAGE));
break;
case SYNC_RSEG:
ut_a(sync_thread_levels_g(array, SYNC_RSEG));
break;
case SYNC_TRX_UNDO:
ut_a(sync_thread_levels_g(array, SYNC_TRX_UNDO));
break;
case SYNC_PURGE_LATCH:
ut_a(sync_thread_levels_g(array, SYNC_PURGE_LATCH));
break;
case SYNC_PURGE_SYS:
ut_a(sync_thread_levels_g(array, SYNC_PURGE_SYS));
break;
case SYNC_TREE_NODE:
ut_a(sync_thread_levels_contain(array, SYNC_INDEX_TREE)
|| sync_thread_levels_g(array, SYNC_TREE_NODE - 1));
......@@ -1131,15 +1105,6 @@ sync_thread_add_level(
&& !sync_thread_levels_contain(
array, SYNC_IBUF_PESS_INSERT_MUTEX));
break;
case SYNC_DICT_AUTOINC_MUTEX:
ut_a(sync_thread_levels_g(array, SYNC_DICT_AUTOINC_MUTEX));
break;
case SYNC_DICT_OPERATION:
ut_a(sync_thread_levels_g(array, SYNC_DICT_OPERATION));
break;
case SYNC_DICT_HEADER:
ut_a(sync_thread_levels_g(array, SYNC_DICT_HEADER));
break;
case SYNC_DICT:
#ifdef UNIV_DEBUG
ut_a(buf_debug_prints
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment