The mutex will be used in subsequent changes to replace the busy looping of a waiter when the futex owner is currently executing the exit cleanup to prevent a potential live lock.
Showing the changes to include/linux (2 of 3 files). Show all
Unified · Split
| @@ -65,6 +65,7 @@ static inline void futex_init_task(struct task_struct *tsk) · 64 unmodified lines | ||
| 65 | 65 | INIT_LIST_HEAD(&tsk->pi_state_list); |
| 66 | 66 | tsk->pi_state_cache = NULL; |
| 67 | 67 | tsk->futex_state = FUTEX_STATE_OK; |
| 68 | + mutex_init(&tsk->futex_exit_mutex); | |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | void futex_exit_recursive(struct task_struct *tsk); |
| @@ -1053,6 +1053,7 @@ struct task_struct { · 1052 unmodified lines | ||
| 1053 | 1053 | #endif |
| 1054 | 1054 | struct list_head pi_state_list; |
| 1055 | 1055 | struct futex_pi_state *pi_state_cache; |
| 1056 | + struct mutex futex_exit_mutex; | |
| 1056 | 1057 | unsigned int futex_state; |
| 1057 | 1058 | #endif |
| 1058 | 1059 | #ifdef CONFIG_PERF_EVENTS |