MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / futex_global_table_find

Function futex_global_table_find

components/lwp/lwp_futex_table.c:42–62  ·  view source on GitHub ↗

* @brief Find a futex in the global hash table * * @param[in] key Pointer to the shared futex key structure * @param[out] futex Pointer to store the found futex * * @return rt_err_t Returns RT_EOK if found, -RT_ENOENT if not found */

Source from the content-addressed store, hash-verified

40 * @return rt_err_t Returns RT_EOK if found, -RT_ENOENT if not found
41 */
42rt_err_t futex_global_table_find(struct shared_futex_key *key, rt_futex_t *futex)
43{
44 rt_err_t rc;
45 rt_futex_t found_futex;
46 struct shared_futex_entry *entry;
47
48 RT_UTHASH_FIND(_futex_hash_head, key, sizeof(struct shared_futex_key), entry);
49 if (entry)
50 {
51 rc = RT_EOK;
52 found_futex = rt_container_of(entry, struct rt_futex, entry);
53 }
54 else
55 {
56 rc = -RT_ENOENT;
57 found_futex = RT_NULL;
58 }
59
60 *futex = found_futex;
61 return rc;
62}
63
64/**
65 * @brief Delete a futex from the global hash table

Callers 1

_sftx_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected