Ignore:
File:
1 edited

Legend:

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

    r05882233 r3cfe2b8  
    537537        h->new_b = NULL;
    538538        h->op = op;
    539         atomic_set(&h->item_cnt, 0);
    540         atomic_set(&h->resize_reqs, 0);
     539        atomic_store(&h->item_cnt, 0);
     540        atomic_store(&h->resize_reqs, 0);
    541541
    542542        if (NULL == op->remove_callback) {
     
    618618
    619619        /* You must clear the table of items. Otherwise cht_destroy will leak. */
    620         assert(atomic_get(&h->item_cnt) == 0);
     620        assert(atomic_load(&h->item_cnt) == 0);
    621621}
    622622
     
    625625{
    626626        /* Wait for resize to complete. */
    627         while (0 < atomic_get(&h->resize_reqs)) {
     627        while (0 < atomic_load(&h->resize_reqs)) {
    628628                rcu_barrier();
    629629        }
     
    21222122
    21232123        if ((need_shrink || missed_shrink) && h->b->order > h->min_order) {
    2124                 atomic_count_t resize_reqs = atomic_preinc(&h->resize_reqs);
     2124                size_t resize_reqs = atomic_preinc(&h->resize_reqs);
    21252125                /* The first resize request. Start the resizer. */
    21262126                if (1 == resize_reqs) {
     
    21432143
    21442144        if ((need_grow || missed_grow) && h->b->order < CHT_MAX_ORDER) {
    2145                 atomic_count_t resize_reqs = atomic_preinc(&h->resize_reqs);
     2145                size_t resize_reqs = atomic_preinc(&h->resize_reqs);
    21462146                /* The first resize request. Start the resizer. */
    21472147                if (1 == resize_reqs) {
     
    21602160        /* Make resize_reqs visible. */
    21612161        read_barrier();
    2162         assert(0 < atomic_get(&h->resize_reqs));
     2162        assert(0 < atomic_load(&h->resize_reqs));
    21632163#endif
    21642164
     
    21682168                /* Load the most recent h->item_cnt. */
    21692169                read_barrier();
    2170                 size_t cur_items = (size_t) atomic_get(&h->item_cnt);
     2170                size_t cur_items = (size_t) atomic_load(&h->item_cnt);
    21712171                size_t bucket_cnt = (1 << h->b->order);
    21722172                size_t max_items = h->max_load * bucket_cnt;
     
    21782178                } else {
    21792179                        /* Table is just the right size. */
    2180                         atomic_count_t reqs = atomic_predec(&h->resize_reqs);
     2180                        size_t reqs = atomic_predec(&h->resize_reqs);
    21812181                        done = (reqs == 0);
    21822182                }
Note: See TracChangeset for help on using the changeset viewer.