Changeset 3ac5086 in mainline for kernel/generic/src/adt/cht.c


Ignore:
Timestamp:
2012-11-24T02:08:55Z (11 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5d230a30
Parents:
d04e46e
Message:

Fixed kernel futex cleanup: now walks list via correct links and frees items once it is sure cht is not resizing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/cht.c

    rd04e46e r3ac5086  
    617617void cht_destroy(cht_t *h)
    618618{
     619        cht_destroy_unsafe(h);
     620       
     621        /* You must clear the table of items. Otherwise cht_destroy will leak. */
     622        ASSERT(atomic_get(&h->item_cnt) == 0);
     623}
     624
     625/** Destroys a successfully created CHT but does no error checking. */
     626void cht_destroy_unsafe(cht_t *h)
     627{
    619628        /* Wait for resize to complete. */
    620629        while (0 < atomic_get(&h->resize_reqs)) {
     
    627636        free(h->b);
    628637        h->b = NULL;
    629        
    630         /* You must clear the table of items. Otherwise cht_destroy will leak. */
    631         ASSERT(atomic_get(&h->item_cnt) == 0);
    632638}
    633639
Note: See TracChangeset for help on using the changeset viewer.