This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | gwlist_create() gw_claim_area(gwlist_create_real()) |
Typedefs | |
| typedef List | List |
| typedef int | gwlist_item_matches_t (void *item, void *pattern) |
| typedef void | gwlist_item_destructor_t (void *item) |
Functions | |
| List * | gwlist_create_real (void) |
| void | gwlist_destroy (List *list, gwlist_item_destructor_t *destructor) |
| long | gwlist_len (List *list) |
| void | gwlist_append (List *list, void *item) |
| void | gwlist_append_unique (List *list, void *item, gwlist_item_matches_t *cmp) |
| void | gwlist_insert (List *list, long pos, void *item) |
| void | gwlist_delete (List *list, long pos, long count) |
| long | gwlist_delete_matching (List *list, void *pat, gwlist_item_matches_t *cmp) |
| long | gwlist_delete_equal (List *list, void *item) |
| void * | gwlist_get (List *list, long pos) |
| void * | gwlist_extract_first (List *list) |
| List * | gwlist_extract_matching (List *list, void *pat, gwlist_item_matches_t *cmp) |
| void | gwlist_lock (List *list) |
| void | gwlist_unlock (List *list) |
| int | gwlist_wait_until_nonempty (List *list) |
| void | gwlist_add_producer (List *list) |
| int | gwlist_producer_count (List *list) |
| void | gwlist_remove_producer (List *list) |
| void | gwlist_produce (List *list, void *item) |
| void * | gwlist_consume (List *list) |
| void * | gwlist_timed_consume (List *list, long sec) |
| void * | gwlist_search (List *list, void *pattern, gwlist_item_matches_t *cmp) |
| List * | gwlist_search_all (List *list, void *pattern, gwlist_item_matches_t *cmp) |
| void | gwlist_sort (List *list, int(*cmp)(const void *, const void *)) |
|
|
|
Definition at line 129 of file list.h. Referenced by dlr_mem_shutdown(). |
|
|
|
|
|
|
|
|
||||||||||||
Here is the call graph for this function:

|
||||||||||||||||
|
Referenced by smsbox_req_handle(). |
|
Here is the call graph for this function:

|
|
Definition at line 126 of file list.c. References List::len, mutex_create, List::nonempty, List::num_producers, List::permanent_lock, List::single_operation_lock, List::start, List::tab, and List::tab_size. 00127 {
00128 List *list;
00129
00130 list = gw_malloc(sizeof(List));
00131 list->tab = NULL;
00132 list->tab_size = 0;
00133 list->start = 0;
00134 list->len = 0;
00135 list->single_operation_lock = mutex_create();
00136 list->permanent_lock = mutex_create();
00137 pthread_cond_init(&list->nonempty, NULL);
00138 list->num_producers = 0;
00139 return list;
00140 }
|
|
||||||||||||||||
|
Definition at line 229 of file list.c. References delete_items_from_list(), lock, and unlock. Referenced by dbpool_check(), dlr_mem_flush(), dlr_mem_remove(), expire_cookies(), have_cookie(), http_header_pack(), http_header_remove_all(), http_header_split_auth_value(), main_for_producer_and_consumer(), mime_entity_remove_part(), mime_entity_replace_part(), pack_challenge(), sanitize_capabilities(), smsc2_restart_smsc(), soap_client_init_query(), and strip_default_capabilities(). 00230 {
00231 lock(list);
00232 delete_items_from_list(list, pos, count);
00233 unlock(list);
00234 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 263 of file list.c. References delete_items_from_list(), GET, List::len, lock, and unlock. Referenced by abort_elapsed(), check_pool_conn(), client_destroy(), handle_method_event(), handle_push_event(), init_machine_destroy(), machine_destroy(), main_for_list_add_and_delete(), push_client_machine_destroy(), remove_push_data(), remove_pushless_session(), remove_session_data(), resp_machine_destroy(), route_msg(), run_smsbox(), run_wapbox(), update_push_data_with_attribute(), and update_session_data(). 00264 {
00265 long i;
00266 long count;
00267
00268 lock(list);
00269
00270 /* XXX this could be made more efficient by noticing
00271 consecutive items to be removed, but leave that for later.
00272 --liw */
00273 i = 0;
00274 count = 0;
00275 while (i < list->len) {
00276 if (GET(list, i) == item) {
00277 delete_items_from_list(list, i, 1);
00278 count++;
00279 } else {
00280 ++i;
00281 }
00282 }
00283 unlock(list);
00284
00285 return count;
00286 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 237 of file list.c. References delete_items_from_list(), GET, List::len, lock, and unlock. Referenced by main_for_list_add_and_delete(), smsbox_req_handle(), update_push_data_with_attribute(), and update_session_data_with_headers(). 00238 {
00239 long i;
00240 long count;
00241
00242 lock(list);
00243
00244 /* XXX this could be made more efficient by noticing
00245 consecutive items to be removed, but leave that for later.
00246 --liw */
00247 i = 0;
00248 count = 0;
00249 while (i < list->len) {
00250 if (matches(GET(list, i), pat)) {
00251 delete_items_from_list(list, i, 1);
00252 count++;
00253 } else {
00254 ++i;
00255 }
00256 }
00257 unlock(list);
00258
00259 return count;
00260 }
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 319 of file list.c. References delete_items_from_list(), GET, gwlist_append(), gwlist_create, gwlist_destroy(), gwlist_len(), List::len, lock, and unlock. Referenced by dict_remove(), heartbeat_stop(), and main_for_extract(). 00320 {
00321 List *new_list;
00322 long i;
00323
00324 new_list = gwlist_create();
00325 lock(list);
00326 i = 0;
00327 while (i < list->len) {
00328 if (cmp(GET(list, i), pat)) {
00329 gwlist_append(new_list, GET(list, i));
00330 delete_items_from_list(list, i, 1);
00331 } else
00332 ++i;
00333 }
00334 unlock(list);
00335
00336 if (gwlist_len(new_list) == 0) {
00337 gwlist_destroy(new_list, NULL);
00338 return NULL;
00339 }
00340 return new_list;
00341 }
|
Here is the call graph for this function:

|
||||||||||||
|
||||||||||||||||
|
Definition at line 211 of file list.c. References GET, gw_assert, INDEX, List::len, lock, make_bigger(), List::nonempty, List::tab, and unlock. Referenced by cfg_read(), expand_file(), handle_transaction(), http_header_pack(), machine_create(), mime_entity_replace_part(), parse_limit(), sms_to_smsboxes(), and smsc2_restart_smsc(). 00212 {
00213 long i;
00214
00215 lock(list);
00216 gw_assert(pos >= 0);
00217 gw_assert(pos <= list->len);
00218
00219 make_bigger(list, 1);
00220 for (i = list->len; i > pos; --i)
00221 list->tab[INDEX(list, i)] = GET(list, i - 1);
00222 list->tab[INDEX(list, pos)] = item;
00223 ++list->len;
00224 pthread_cond_signal(&list->nonempty);
00225 unlock(list);
00226 }
|
Here is the call graph for this function:

|
|
|
Definition at line 344 of file list.c. References gw_assert, mutex_lock, and List::permanent_lock. Referenced by alog(), alog_close(), alog_reopen(), boxc_incoming_wdp_queue(), boxc_status(), client_destroy(), dbpool_check(), dbpool_conn_consume(), dbpool_decrease(), dbpool_increase(), gw_rwlock_rdlock(), gw_rwlock_wrlock(), port_remove(), route_msg(), run_wapbox(), set_tid_by_item(), soap_client_have_response(), soap_client_init_query(), udp_addwdp(), udp_outgoing_queue(), udpc_find_mapping(), wdp_to_wapboxes(), and xmlrpc_call_print(). 00345 {
00346 gw_assert(list != NULL);
00347 mutex_lock(list->permanent_lock);
00348 }
|
|
||||||||||||
Here is the call graph for this function:

|
|
Definition at line 386 of file list.c. References lock, List::num_producers, and unlock. Referenced by gw_rwlock_wrlock(), main(), run_smsbox(), run_wapbox(), and sms_to_smsboxes(). 00387 {
00388 int ret;
00389 lock(list);
00390 ret = list->num_producers;
00391 unlock(list);
00392 return ret;
00393 }
|
|
|
||||||||||||||||
|
||||||||||||||||
|
Referenced by disconnect_other_sessions(), port_remove(), and release_holding_methods(). |
|
||||||||||||
|
Definition at line 512 of file list.c. References GET, gw_assert, List::len, lock, and unlock. Referenced by main(). 00513 {
00514 gw_assert(list != NULL && cmp != NULL);
00515
00516 lock(list);
00517 if (list->len == 0) {
00518 /* nothing to sort */
00519 unlock(list);
00520 return;
00521 }
00522 qsort(&GET(list, 0), list->len, sizeof(void*), cmp);
00523 unlock(list);
00524 }
|
|
||||||||||||
|
Definition at line 434 of file list.c. References delete_items_from_list(), GET, gwthread_self(), List::len, lock, Mutex::mutex, List::nonempty, List::num_producers, Mutex::owner, List::single_operation_lock, and unlock. Referenced by sms_router(). 00435 {
00436 void *item;
00437 struct timespec abstime;
00438 int rc;
00439
00440 abstime.tv_sec = time(NULL) + sec;
00441 abstime.tv_nsec = 0;
00442
00443 lock(list);
00444 while (list->len == 0 && list->num_producers > 0) {
00445 list->single_operation_lock->owner = -1;
00446 rc = pthread_cond_timedwait(&list->nonempty,
00447 &list->single_operation_lock->mutex, &abstime);
00448 list->single_operation_lock->owner = gwthread_self();
00449 if (rc == ETIMEDOUT)
00450 break;
00451 }
00452 if (list->len > 0) {
00453 item = GET(list, 0);
00454 delete_items_from_list(list, 0, 1);
00455 } else {
00456 item = NULL;
00457 }
00458 unlock(list);
00459 return item;
00460 }
|
Here is the call graph for this function:

|
|
Definition at line 351 of file list.c. References gw_assert, mutex_unlock, and List::permanent_lock. Referenced by alog(), alog_close(), alog_reopen(), boxc_incoming_wdp_queue(), boxc_status(), client_destroy(), dbpool_check(), dbpool_conn_consume(), dbpool_decrease(), dbpool_increase(), gw_rwlock_rdlock(), gw_rwlock_unlock(), port_remove(), route_msg(), run_wapbox(), set_tid_by_item(), soap_client_have_response(), soap_client_init_query(), udp_addwdp(), udp_outgoing_queue(), udpc_find_mapping(), wdp_to_wapboxes(), and xmlrpc_call_print(). 00352 {
00353 gw_assert(list != NULL);
00354 mutex_unlock(list->permanent_lock);
00355 }
|
|
|
Definition at line 358 of file list.c. References gwthread_self(), List::len, lock, Mutex::mutex, List::nonempty, List::num_producers, Mutex::owner, List::single_operation_lock, and unlock. Referenced by smsboxc_run(), wait_for_connections(), and wapboxc_run(). 00359 {
00360 int ret;
00361
00362 lock(list);
00363 while (list->len == 0 && list->num_producers > 0) {
00364 list->single_operation_lock->owner = -1;
00365 pthread_cond_wait(&list->nonempty,
00366 &list->single_operation_lock->mutex);
00367 list->single_operation_lock->owner = gwthread_self();
00368 }
00369 if (list->len > 0)
00370 ret = 1;
00371 else
00372 ret = -1;
00373 unlock(list);
00374 return ret;
00375 }
|
Here is the call graph for this function:
