Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/apache2/modperl_tipool.h
$ cat -n /usr/include/apache2/modperl_tipool.h 1 /* Licensed to the Apache Software Foundation (ASF) under one or more 2 * contributor license agreements. See the NOTICE file distributed with 3 * this work for additional information regarding copyright ownership. 4 * The ASF licenses this file to You under the Apache License, Version 2.0 5 * (the "License"); you may not use this file except in compliance with 6 * the License. You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MODPERL_TIPOOL_H 18 #define MODPERL_TIPOOL_H 19 20 #ifdef USE_ITHREADS 21 22 modperl_list_t *modperl_list_new(void); 23 24 modperl_list_t *modperl_list_last(modperl_list_t *list); 25 26 modperl_list_t *modperl_list_first(modperl_list_t *list); 27 28 modperl_list_t *modperl_list_append(modperl_list_t *list, 29 modperl_list_t *new_list); 30 31 modperl_list_t *modperl_list_prepend(modperl_list_t *list, 32 modperl_list_t *new_list); 33 34 modperl_list_t *modperl_list_remove(modperl_list_t *list, 35 modperl_list_t *rlist); 36 37 modperl_tipool_t *modperl_tipool_new(apr_pool_t *p, 38 modperl_tipool_config_t *cfg, 39 modperl_tipool_vtbl_t *func, 40 void *data); 41 42 void modperl_tipool_init(modperl_tipool_t *tipool); 43 44 void modperl_tipool_destroy(modperl_tipool_t *tipool); 45 46 void modperl_tipool_add(modperl_tipool_t *tipool, void *data); 47 48 void modperl_tipool_remove(modperl_tipool_t *tipool, modperl_list_t *listp); 49 50 modperl_list_t *modperl_list_remove_data(modperl_list_t *list, 51 void *data, 52 modperl_list_t **listp); 53 54 modperl_list_t *modperl_tipool_pop(modperl_tipool_t *tipool); 55 56 void modperl_tipool_putback(modperl_tipool_t *tipool, 57 modperl_list_t *listp, 58 int num_requests); 59 60 void modperl_tipool_putback_data(modperl_tipool_t *tipool, void *data, 61 int num_requests); 62 63 #define modperl_tipool_wait(tipool) \ 64 while (tipool->size == tipool->in_use) { \ 65 MP_TRACE_i(MP_FUNC, \ 66 "waiting for available tipool item in thread 0x%lx", \ 67 MP_TIDF); \ 68 MP_TRACE_i(MP_FUNC, "(%d items in use, %d alive)", \ 69 tipool->in_use, tipool->size); \ 70 COND_WAIT(&tipool->available, &tipool->tiplock); \ 71 } 72 73 #define modperl_tipool_broadcast(tipool) \ 74 MP_TRACE_i(MP_FUNC, "broadcast available tipool item"); \ 75 COND_SIGNAL(&tipool->available) 76 77 #define modperl_tipool_lock(tipool) \ 78 MP_TRACE_i(MP_FUNC, "about to lock tipool in thread 0x%lx", MP_TIDF); \ 79 MUTEX_LOCK(&tipool->tiplock); \ 80 MP_TRACE_i(MP_FUNC, "acquired tipool lock") 81 82 #define modperl_tipool_unlock(tipool) \ 83 MP_TRACE_i(MP_FUNC, "about to unlock tipool in thread 0x%lx", MP_TIDF); \ 84 MUTEX_UNLOCK(&tipool->tiplock); \ 85 MP_TRACE_i(MP_FUNC, "released tipool lock") 86 87 #endif /* USE_ITHREADS */ 88 89 #endif /* MODPERL_TIPOOL_H */ 90 91 /* 92 * Local Variables: 93 * c-basic-offset: 4 94 * indent-tabs-mode: nil 95 * End: 96 */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™