| .. | .. |
|---|
| 90 | 90 | |
|---|
| 91 | 91 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
|---|
| 92 | 92 | |
|---|
| 93 | +#ifdef CONFIG_PREEMPT_RT_BASE |
|---|
| 94 | +extern void __put_task_struct_cb(struct rcu_head *rhp); |
|---|
| 95 | + |
|---|
| 96 | +static inline void put_task_struct(struct task_struct *t) |
|---|
| 97 | +{ |
|---|
| 98 | + if (atomic_dec_and_test(&t->usage)) |
|---|
| 99 | + call_rcu(&t->put_rcu, __put_task_struct_cb); |
|---|
| 100 | +} |
|---|
| 101 | +#else |
|---|
| 93 | 102 | extern void __put_task_struct(struct task_struct *t); |
|---|
| 94 | 103 | |
|---|
| 95 | 104 | static inline void put_task_struct(struct task_struct *t) |
|---|
| .. | .. |
|---|
| 97 | 106 | if (atomic_dec_and_test(&t->usage)) |
|---|
| 98 | 107 | __put_task_struct(t); |
|---|
| 99 | 108 | } |
|---|
| 100 | | - |
|---|
| 109 | +#endif |
|---|
| 101 | 110 | struct task_struct *task_rcu_dereference(struct task_struct **ptask); |
|---|
| 102 | 111 | |
|---|
| 103 | 112 | #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT |
|---|