| 555 |
p_section_list_pool = NULL; |
p_section_list_pool = NULL; |
| 556 |
} |
} |
| 557 |
|
|
| 558 |
|
void section_list_ex_menu_set_cleanup(void) |
| 559 |
|
{ |
| 560 |
|
int i; |
| 561 |
|
|
| 562 |
|
for (i = 0; i < p_section_list_pool->section_count; i++) |
| 563 |
|
{ |
| 564 |
|
if (p_section_list_pool->sections[i].ex_menu_tm > 0) |
| 565 |
|
{ |
| 566 |
|
unload_menu(&(p_section_list_pool->sections[i].ex_menu_set)); |
| 567 |
|
} |
| 568 |
|
} |
| 569 |
|
} |
| 570 |
|
|
| 571 |
int set_section_list_shm_readonly(void) |
int set_section_list_shm_readonly(void) |
| 572 |
{ |
{ |
| 573 |
int shmid; |
int shmid; |
| 643 |
p_section = p_section_list_pool->sections + p_section_list_pool->section_count; |
p_section = p_section_list_pool->sections + p_section_list_pool->section_count; |
| 644 |
|
|
| 645 |
p_section->sid = sid; |
p_section->sid = sid; |
| 646 |
|
p_section->ex_menu_tm = 0; |
| 647 |
|
|
| 648 |
strncpy(p_section->sname, sname, sizeof(p_section->sname) - 1); |
strncpy(p_section->sname, sname, sizeof(p_section->sname) - 1); |
| 649 |
p_section->sname[sizeof(p_section->sname) - 1] = '\0'; |
p_section->sname[sizeof(p_section->sname) - 1] = '\0'; |
| 1709 |
timer++; |
timer++; |
| 1710 |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
| 1711 |
{ |
{ |
| 1712 |
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); |
| 1713 |
} |
} |
| 1714 |
} |
} |
| 1715 |
else // failed |
else // failed |
| 1716 |
{ |
{ |
| 1717 |
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); |
| 1718 |
break; |
break; |
| 1719 |
} |
} |
| 1720 |
} |
} |
| 1740 |
timer++; |
timer++; |
| 1741 |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
if (timer % SECTION_TRY_LOCK_TIMES == 0) |
| 1742 |
{ |
{ |
| 1743 |
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); |
| 1744 |
} |
} |
| 1745 |
} |
} |
| 1746 |
else // failed |
else // failed |
| 1747 |
{ |
{ |
| 1748 |
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); |
| 1749 |
break; |
break; |
| 1750 |
} |
} |
| 1751 |
} |
} |