Changeset 0722869 in mainline for kernel/generic/src/ipc/kbox.c
- Timestamp:
- 2017-12-09T18:21:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bd253241
- Parents:
- 071a1ddb (diff), 0016674 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-09 18:21:29)
- git-committer:
- GitHub <noreply@…> (2017-12-09 18:21:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/kbox.c
r071a1ddb r0722869 206 206 * cleanup code. 207 207 * 208 * @return Phone capability handle on success, or negative error code. 209 * 210 */ 211 int ipc_connect_kbox(task_id_t taskid) 208 * @param[out] out_phone Phone capability handle on success. 209 * @return Error code. 210 * 211 */ 212 int ipc_connect_kbox(task_id_t taskid, cap_handle_t *out_phone) 212 213 { 213 214 irq_spinlock_lock(&tasks_lock, true); … … 231 232 } 232 233 233 if (task->kb.finished != false) {234 if (task->kb.finished) { 234 235 mutex_unlock(&task->kb.cleanup_lock); 235 236 return EINVAL; 236 237 } 237 238 239 /* Create a kbox thread if necessary. */ 240 if (task->kb.thread == NULL) { 241 thread_t *kb_thread = thread_create(kbox_thread_proc, NULL, task, 242 THREAD_FLAG_NONE, "kbox"); 243 244 if (!kb_thread) { 245 mutex_unlock(&task->kb.cleanup_lock); 246 return ENOMEM; 247 } 248 249 task->kb.thread = kb_thread; 250 thread_ready(kb_thread); 251 } 252 253 /* Allocate a new phone. */ 238 254 cap_handle_t phone_handle = phone_alloc(TASK); 239 255 if (phone_handle < 0) { … … 248 264 (void) ipc_phone_connect(phone_obj->phone, &task->kb.box); 249 265 250 if (task->kb.thread != NULL) {251 mutex_unlock(&task->kb.cleanup_lock);252 return phone_handle;253 }254 255 /* Create a kbox thread */256 thread_t *kb_thread = thread_create(kbox_thread_proc, NULL, task,257 THREAD_FLAG_NONE, "kbox");258 if (!kb_thread) {259 mutex_unlock(&task->kb.cleanup_lock);260 return ENOMEM;261 }262 263 task->kb.thread = kb_thread;264 thread_ready(kb_thread);265 266 266 mutex_unlock(&task->kb.cleanup_lock); 267 268 return phone_handle;267 *out_phone = phone_handle; 268 return EOK; 269 269 } 270 270
Note:
See TracChangeset
for help on using the changeset viewer.