Changeset 1871118 in mainline for kernel/generic/src/udebug/udebug_ops.c
- Timestamp:
- 2023-02-10T22:59:11Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11d2c983
- Parents:
- daadfa6
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-10 22:53:12)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-10 22:59:11)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/udebug/udebug_ops.c
rdaadfa6 r1871118 83 83 mutex_lock(&TASK->udebug.lock); 84 84 85 /* thread_exists() must be called with threads_lock held */ 86 irq_spinlock_lock(&threads_lock, true); 87 88 if (!thread_exists(thread)) { 89 irq_spinlock_unlock(&threads_lock, true); 85 thread = thread_try_get(thread); 86 87 if (!thread) { 90 88 mutex_unlock(&TASK->udebug.lock); 91 89 return ENOENT; 92 90 } 93 91 94 /* thread->lock is enough to ensure the thread's existence */ 95 irq_spinlock_exchange(&threads_lock, &thread->lock); 92 irq_spinlock_lock(&thread->lock, true); 96 93 97 94 /* Verify that 'thread' is a userspace thread. */ … … 111 108 } 112 109 113 /*114 * Since the thread has active == true, TASK->udebug.lock115 * is enough to ensure its existence and that active remains116 * true.117 *118 */119 irq_spinlock_unlock(&thread->lock, true);120 121 /* Only mutex TASK->udebug.lock left. */122 123 110 /* Now verify that the thread belongs to the current task. */ 124 111 if (thread->task != TASK) { 125 112 /* No such thread belonging this task */ 113 irq_spinlock_unlock(&thread->lock, true); 126 114 mutex_unlock(&TASK->udebug.lock); 127 115 return ENOENT; 128 116 } 117 118 irq_spinlock_unlock(&thread->lock, true); 119 120 /* Only mutex TASK->udebug.lock left. */ 129 121 130 122 /* … … 153 145 { 154 146 mutex_unlock(&thread->udebug.lock); 147 148 /* Drop reference from _thread_op_begin() */ 149 thread_put(thread); 155 150 } 156 151
Note:
See TracChangeset
for help on using the changeset viewer.