Ignore:
Timestamp:
2018-03-14T18:54:08Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67f11a0
Parents:
963037b0
Message:

Make hash_table_find_next immune to livelocks

By giving hash_table_find_next the item returned from hash_table_find,
we provide it with a fixed reference with which the outer loop which
calls hash_table_find_next can terminate even if the respective bucket
contains more matching elements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/hash_table.h

    r963037b0 r30f1a25  
    9595extern bool hash_table_insert_unique(hash_table_t *, ht_link_t *);
    9696extern ht_link_t *hash_table_find(const hash_table_t *, void *);
    97 extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *);
     97extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *,
     98    ht_link_t *);
    9899extern size_t hash_table_remove(hash_table_t *, void *);
    99100extern void hash_table_remove_item(hash_table_t *, ht_link_t *);
Note: See TracChangeset for help on using the changeset viewer.