| 75 |
|
|
| 76 |
static ARTICLE_BLOCK_POOL *p_article_block_pool = NULL; |
static ARTICLE_BLOCK_POOL *p_article_block_pool = NULL; |
| 77 |
|
|
| 78 |
struct section_list_pool_t |
SECTION_LIST_POOL *p_section_list_pool = NULL; |
|
{ |
|
|
int shmid; |
|
|
SECTION_LIST sections[BBS_max_section]; |
|
|
int section_count; |
|
|
int semid; |
|
|
TRIE_NODE *p_trie_dict_section_by_name; |
|
|
TRIE_NODE *p_trie_dict_section_by_sid; |
|
|
}; |
|
|
typedef struct section_list_pool_t SECTION_LIST_POOL; |
|
|
|
|
|
static SECTION_LIST_POOL *p_section_list_pool = NULL; |
|
| 79 |
|
|
| 80 |
int article_block_init(const char *filename, int block_count) |
int article_block_init(const char *filename, int block_count) |
| 81 |
{ |
{ |
| 544 |
p_section_list_pool = NULL; |
p_section_list_pool = NULL; |
| 545 |
} |
} |
| 546 |
|
|
|
void section_list_ex_menu_set_cleanup(void) |
|
|
{ |
|
|
int i; |
|
|
|
|
|
for (i = 0; i < p_section_list_pool->section_count; i++) |
|
|
{ |
|
|
if (p_section_list_pool->sections[i].ex_menu_tm > 0) |
|
|
{ |
|
|
unload_menu(&(p_section_list_pool->sections[i].ex_menu_set)); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
| 547 |
int set_section_list_shm_readonly(void) |
int set_section_list_shm_readonly(void) |
| 548 |
{ |
{ |
| 549 |
int shmid; |
int shmid; |
| 1685 |
timer++; |
timer++; |
| 1686 |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
| 1687 |
{ |
{ |
| 1688 |
log_error("section_list_rd_lock() tried %d times on section %d\n", sid, timer); |
log_error("section_list_try_rd_lock() tried %d times on section %d\n", sid, timer); |
| 1689 |
} |
} |
| 1690 |
} |
} |
| 1691 |
else // failed |
else // failed |
| 1692 |
{ |
{ |
| 1693 |
log_error("section_list_rd_lock() failed on section %d\n", sid); |
log_error("section_list_try_rd_lock() failed on section %d\n", sid); |
| 1694 |
break; |
break; |
| 1695 |
} |
} |
| 1696 |
} |
} |
| 1716 |
timer++; |
timer++; |
| 1717 |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
| 1718 |
{ |
{ |
| 1719 |
log_error("acquire_section_rw_lock() tried %d times on section %d\n", sid, timer); |
log_error("section_list_try_rw_lock() tried %d times on section %d\n", sid, timer); |
| 1720 |
} |
} |
| 1721 |
} |
} |
| 1722 |
else // failed |
else // failed |
| 1723 |
{ |
{ |
| 1724 |
log_error("acquire_section_rw_lock() failed on section %d\n", sid); |
log_error("section_list_try_rw_lock() failed on section %d\n", sid); |
| 1725 |
break; |
break; |
| 1726 |
} |
} |
| 1727 |
} |
} |