Changeset 0016674 in mainline for kernel/generic/src/ipc/kbox.c
- Timestamp:
- 2017-12-09T18:04:23Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0722869
- Parents:
- 569a51a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/kbox.c
r569a51a r0016674 232 232 } 233 233 234 if (task->kb.finished != false) {234 if (task->kb.finished) { 235 235 mutex_unlock(&task->kb.cleanup_lock); 236 236 return EINVAL; 237 237 } 238 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. */ 239 254 cap_handle_t phone_handle = phone_alloc(TASK); 240 255 if (phone_handle < 0) { … … 249 264 (void) ipc_phone_connect(phone_obj->phone, &task->kb.box); 250 265 251 if (task->kb.thread != NULL) {252 mutex_unlock(&task->kb.cleanup_lock);253 *out_phone = phone_handle;254 return EOK;255 }256 257 /* Create a kbox thread */258 thread_t *kb_thread = thread_create(kbox_thread_proc, NULL, task,259 THREAD_FLAG_NONE, "kbox");260 if (!kb_thread) {261 // FIXME: Shouldn't we clean up phone_handle?262 mutex_unlock(&task->kb.cleanup_lock);263 return ENOMEM;264 }265 266 task->kb.thread = kb_thread;267 thread_ready(kb_thread);268 269 266 mutex_unlock(&task->kb.cleanup_lock); 270 271 267 *out_phone = phone_handle; 272 268 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.