| 148 | } |
| 149 | |
| 150 | AP_DECLARE(void) ap_init_scoreboard(void *shared_score) |
| 151 | { |
| 152 | char *more_storage; |
| 153 | int i; |
| 154 | |
| 155 | pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes); |
| 156 | if (!shared_score) { |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | ap_calc_scoreboard_size(); |
| 161 | ap_scoreboard_image = |
| 162 | ap_calloc(1, SIZE_OF_scoreboard + server_limit * sizeof(worker_score *)); |
| 163 | more_storage = shared_score; |
| 164 | ap_scoreboard_image->global = (global_score *)more_storage; |
| 165 | more_storage += SIZE_OF_global_score; |
| 166 | ap_scoreboard_image->parent = (process_score *)more_storage; |
| 167 | more_storage += SIZE_OF_process_score * server_limit; |
| 168 | ap_scoreboard_image->servers = |
| 169 | (worker_score **)((char*)ap_scoreboard_image + SIZE_OF_scoreboard); |
| 170 | for (i = 0; i < server_limit; i++) { |
| 171 | ap_scoreboard_image->servers[i] = (worker_score *)more_storage; |
| 172 | more_storage += thread_limit * SIZE_OF_worker_score; |
| 173 | } |
| 174 | ap_assert(more_storage == (char*)shared_score + scoreboard_size); |
| 175 | ap_scoreboard_image->global->server_limit = server_limit; |
| 176 | ap_scoreboard_image->global->thread_limit = thread_limit; |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Create a name-based scoreboard in the given pool using the |
no test coverage detected