Function report |
Source Code:kernel\futex.c |
Create Date:2022-07-28 10:54:16 |
Last Modify:2020-03-17 15:28:32 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:ex_requeue() - Requeue waiters from uaddr1 to uaddr2*@uaddr1: source futex user address*@flags: futex flags (FLAGS_SHARED, etc
Proto:static int futex_requeue(unsigned int __user *uaddr1, unsigned int flags, unsigned int __user *uaddr2, int nr_wake, int nr_requeue, unsigned int *cmpval, int requeue_pi)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned int __user * | uaddr1 | |
unsigned int | flags | |
unsigned int __user * | uaddr2 | |
int | nr_wake | |
int | nr_requeue | |
unsigned int * | cmpval | |
int | requeue_pi |
2003 | key1 = FUTEX_KEY_INIT , key2 = FUTEX_KEY_INIT |
2004 | drop_count = 0 , task_count = 0 |
2005 | struct futex_pi_state * pi_state = NULL |
2010 | If nr_wake < 0 || nr_requeue < 0 Then Return -EINVAL |
2019 | If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FUTEX_PI) && requeue_pi Then Return -ENOSYS |
2022 | If requeue_pi Then |
2050 | retry : |
2052 | If Value for the false possibility is greater at compile time(ret != 0) Then Go to out |
2056 | If Value for the false possibility is greater at compile time(ret != 0) Then Go to out_put_key1 |
2065 | Go to out_put_keys |
2071 | retry_private : |
2075 | If Value is more likely to compile time(cmpval != NULL) Then |
2078 | ret = get_futex_value_locked( & curval, uaddr1) |
2081 | double_unlock_hb(hb1, hb2) |
2085 | If ret Then Go to out_put_keys |
2088 | If Not (flags & Futex flags used to encode options to functions and preserve them across* restarts.) Then Go to retry_private |
2091 | put_futex_key( & key2) |
2092 | put_futex_key( & key1) |
2093 | Go to retry |
2097 | Go to out_unlock |
2101 | If requeue_pi && task_count - nr_wake < nr_requeue Then |
2102 | struct task_struct * exiting = NULL |
2123 | If ret > 0 Then |
2125 | drop_count++ |
2126 | task_count++ |
2144 | Case ret == 0 |
2146 | Break |
2150 | double_unlock_hb(hb1, hb2) |
2152 | put_futex_key( & key2) |
2153 | put_futex_key( & key1) |
2157 | Go to out |
2166 | double_unlock_hb(hb1, hb2) |
2168 | put_futex_key( & key2) |
2169 | put_futex_key( & key1) |
2176 | cond_resched() |
2177 | Go to retry |
2178 | Default |
2179 | Go to out_unlock |
2184 | If task_count - nr_wake >= nr_requeue Then Break |
2187 | If Not match_futex - Check whether two futex keys are equal*@key1: Pointer to key1*@key2: Pointer to key2* Return 1 if two futex_keys are equal, 0 otherwise. Then Continue |
2197 | If requeue_pi && Not rt_waiter || Not requeue_pi && rt_waiter || pi_state Then |
2209 | If ++task_count <= nr_wake && Not requeue_pi Then |
2224 | If requeue_pi Then |
2230 | get_pi_state(pi_state) |
2235 | If ret == 1 Then |
2245 | drop_count++ |
2246 | Continue |
2247 | Else if ret Then |
2256 | pi_state = NULL |
2257 | Drops a reference to the pi_state object and frees or caches it* when the last reference is gone. |
2262 | Break |
2266 | drop_count++ |
2274 | Drops a reference to the pi_state object and frees or caches it* when the last reference is gone. |
2276 | out_unlock : |
2277 | double_unlock_hb(hb1, hb2) |
2287 | When --drop_count >= 0 cycle |
2290 | out_put_keys : |
2291 | put_futex_key( & key2) |
2292 | out_put_key1 : |
2293 | put_futex_key( & key1) |
2294 | out : |
2295 | Return If ret Then ret Else task_count |
Name | Describe |
---|---|
do_futex |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |