Changeset 012dd8e in mainline for uspace/lib/c/generic/task.c
- Timestamp:
- 2019-08-07T09:15:30Z (6 years ago)
- Children:
- e8747bd8
- Parents:
- 780c8ce
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-11-01 00:08:04)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-07 09:15:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/task.c
r780c8ce r012dd8e 49 49 #include <str.h> 50 50 #include <task.h> 51 #include <taskman.h> 51 52 #include <vfs/vfs.h> 52 #include "private/ns.h" 53 53 54 #include "private/task.h" 54 55 static async_sess_t *session_taskman = NULL; 55 #include "private/taskman.h" 56 56 57 57 task_id_t task_get_id(void) … … 69 69 } 70 70 71 async_exch_t *taskman_exchange_begin(void)72 {73 /* Lazy connection */74 if (session_taskman == NULL) {75 // TODO unify exchange mgmt with taskman_handshake/__init76 session_taskman = service_connect_blocking(EXCHANGE_SERIALIZE,77 SERVICE_TASKMAN,78 TASKMAN_CONTROL,79 0);80 }81 82 if (session_taskman == NULL) {83 return NULL;84 }85 86 async_exch_t *exch = async_exchange_begin(session_taskman);87 return exch;88 }89 90 void taskman_exchange_end(async_exch_t *exch)91 {92 async_exchange_end(exch);93 }94 95 71 /** Set the task name. 96 72 * … … 129 105 * 130 106 * @return EOK on success, else error code. 131 * @return TODO check this doesn't return EINVAL -- clash with task_wait132 107 */ 133 108 static errno_t task_setup_wait(task_id_t id, task_wait_t *wait) … … 393 368 * (it can be reused, but must be reinitialized with task_setup_wait first) 394 369 * 395 * @param wait task_wait_t previously initialized by task_setup_wait. 396 * @param texit Store type of task exit here. 397 * @param retval Store return value of the task here. 370 * @param[in/out] wait task_wait_t previously initialized by task_setup_wait 371 * or returned by task_wait with non-zero flags. the 372 * flags are updated so that they represent what can be 373 * still waited for. 374 * @param[out] texit Store type of task exit here. 375 * @param[out] retval Store return value of the task here. 398 376 * 399 377 * @return EOK on success 400 * @return EIN VAL on lost wait TODO other error codes378 * @return EINTR on lost wait 401 379 */ 402 380 errno_t task_wait(task_wait_t *wait, task_exit_t *texit, int *retval) … … 405 383 async_wait_for(wait->aid, &rc); 406 384 407 if (rc == EOK || rc == EIN VAL) {385 if (rc == EOK || rc == EINTR) { 408 386 if (wait->flags & TASK_WAIT_EXIT && texit) 409 387 *texit = ipc_get_arg1(wait->result); … … 471 449 } 472 450 473 void __task_init(async_sess_t *sess)474 {475 assert(session_taskman == NULL);476 session_taskman = sess;477 }478 479 451 /** @} 480 452 */
Note:
See TracChangeset
for help on using the changeset viewer.