Lines Matching defs:table

9 	return &threads->table[(unsigned int)tid % THREADS__TABLE_SIZE];
14 /* The table lookup removes low bit entropy, but this is just ignored here. */
26 struct threads_table_entry *table = &threads->table[i];
28 hashmap__init(&table->shard, key_hash, key_equal, NULL);
29 init_rwsem(&table->lock);
30 table->last_match = NULL;
38 struct threads_table_entry *table = &threads->table[i];
40 hashmap__clear(&table->shard);
41 exit_rwsem(&table->lock);
50 struct threads_table_entry *table = &threads->table[i];
52 down_read(&table->lock);
53 nr += hashmap__size(&table->shard);
54 up_read(&table->lock);
64 static struct thread *__threads_table_entry__get_last_match(struct threads_table_entry *table,
69 th = table->last_match;
77 static void __threads_table_entry__set_last_match(struct threads_table_entry *table,
80 thread__put(table->last_match);
81 table->last_match = thread__get(th);
84 static void threads_table_entry__set_last_match(struct threads_table_entry *table,
87 down_write(&table->lock);
88 __threads_table_entry__set_last_match(table, th);
89 up_write(&table->lock);
94 struct threads_table_entry *table = threads__table(threads, tid);
97 down_read(&table->lock);
98 res = __threads_table_entry__get_last_match(table, tid);
100 if (hashmap__find(&table->shard, tid, &res))
103 up_read(&table->lock);
105 threads_table_entry__set_last_match(table, res);
111 struct threads_table_entry *table = threads__table(threads, tid);
115 down_write(&table->lock);
118 if (hashmap__add(&table->shard, tid, res)) {
122 if (hashmap__find(&table->shard, tid, &res))
129 __threads_table_entry__set_last_match(table, res);
131 up_write(&table->lock);
138 struct threads_table_entry *table = &threads->table[i];
142 down_write(&table->lock);
143 __threads_table_entry__set_last_match(table, NULL);
144 hashmap__for_each_entry_safe((&table->shard), cur, tmp, bkt) {
147 hashmap__delete(&table->shard, cur->key, /*old_key=*/NULL, &old_value);
150 up_write(&table->lock);
156 struct threads_table_entry *table = threads__table(threads, thread__tid(thread));
159 down_write(&table->lock);
160 if (table->last_match && RC_CHK_EQUAL(table->last_match, thread))
161 __threads_table_entry__set_last_match(table, NULL);
163 hashmap__delete(&table->shard, thread__tid(thread), /*old_key=*/NULL, &old_value);
165 up_write(&table->lock);
173 struct threads_table_entry *table = &threads->table[i];
177 down_read(&table->lock);
178 hashmap__for_each_entry((&table->shard), cur, bkt) {
182 up_read(&table->lock);
186 up_read(&table->lock);