Changeset 9c1c677 in mainline


Ignore:
Timestamp:
2006-06-05T14:27:08Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
31e8ddd
Parents:
b91bb65
Message:

futex_cleanup() implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/synch/futex.c

    rb91bb65 r9c1c677  
    308308void futex_cleanup(void)
    309309{
    310 }
     310        link_t *cur;
     311       
     312        rwlock_write_lock(&futex_ht_lock);
     313        mutex_lock(&TASK->futexes_lock);
     314
     315        for (cur = TASK->futexes.leaf_head.next; cur != &TASK->futexes.leaf_head; cur = cur->next) {
     316                btree_node_t *node;
     317                int i;
     318               
     319                node = list_get_instance(cur, btree_node_t, leaf_link);
     320                for (i = 0; i < node->keys; i++) {
     321                        futex_t *ftx;
     322                        __address paddr = node->key[i];
     323                       
     324                        ftx = (futex_t *) node->value[i];
     325                        if (--ftx->refcount == 0)
     326                                hash_table_remove(&futex_ht, &paddr, 1);
     327                }
     328        }
     329       
     330        mutex_unlock(&TASK->futexes_lock);
     331        rwlock_write_unlock(&futex_ht_lock);
     332}
Note: See TracChangeset for help on using the changeset viewer.