Changes in / [613d644:cb1fd3e] in mainline
- Location:
- uspace
- Files:
-
- 1 deleted
- 32 edited
-
app/bdsh/exec.c (modified) (3 diffs)
-
app/getterm/getterm.c (modified) (2 diffs)
-
app/init/init.c (modified) (6 diffs)
-
app/redir/redir.c (modified) (3 diffs)
-
app/sbi/src/os/helenos.c (modified) (2 diffs)
-
app/trace/trace.c (modified) (1 diff)
-
app/viewer/viewer.c (modified) (1 diff)
-
app/vlaunch/vlaunch.c (modified) (2 diffs)
-
lib/c/generic/task.c (modified) (16 diffs)
-
lib/c/include/async.h (modified) (1 diff)
-
lib/c/include/ipc/common.h (modified) (1 diff)
-
lib/c/include/ipc/ipc.h (modified) (1 diff)
-
lib/c/include/loader/loader.h (modified) (1 diff)
-
lib/c/include/task.h (modified) (2 diffs)
-
lib/c/include/types/task.h (deleted)
-
lib/gui/terminal.c (modified) (1 diff)
-
lib/hound/src/client.c (modified) (1 diff)
-
lib/posix/source/sys/wait.c (modified) (1 diff)
-
srv/audio/hound/main.c (modified) (1 diff)
-
srv/bd/sata_bd/sata_bd.c (modified) (1 diff)
-
srv/devman/driver.c (modified) (2 diffs)
-
srv/hid/isdv4_tablet/main.c (modified) (1 diff)
-
srv/hid/remcons/remcons.c (modified) (2 diffs)
-
srv/hid/rfb/main.c (modified) (1 diff)
-
srv/net/ethip/ethip.c (modified) (1 diff)
-
srv/net/inetsrv/inetsrv.c (modified) (1 diff)
-
srv/net/loopip/loopip.c (modified) (1 diff)
-
srv/net/nconfsrv/nconfsrv.c (modified) (1 diff)
-
srv/net/slip/slip.c (modified) (1 diff)
-
srv/ns/ns.c (modified) (1 diff)
-
srv/ns/task.c (modified) (6 diffs)
-
srv/ns/task.h (modified) (1 diff)
-
srv/taskmon/taskmon.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/exec.c
r613d644 rcb1fd3e 97 97 { 98 98 task_id_t tid; 99 task_wait_t twait;100 99 task_exit_t texit; 101 100 char *tmp; … … 122 121 file_handles_p[i] = NULL; 123 122 124 rc = task_spawnvf(&tid, &twait,tmp, (const char **) argv, file_handles_p);123 rc = task_spawnvf(&tid, tmp, (const char **) argv, file_handles_p); 125 124 free(tmp); 126 125 … … 131 130 } 132 131 133 rc = task_wait( &twait, &texit, &retval);132 rc = task_wait(tid, &texit, &retval); 134 133 if (rc != EOK) { 135 134 printf("%s: Failed waiting for command (%s)\n", progname, -
uspace/app/getterm/getterm.c
r613d644 rcb1fd3e 165 165 166 166 task_id_t id; 167 task_wait_t twait;168 167 169 int rc = task_spawnv(&id, &twait,cmd, (const char * const *) args);168 int rc = task_spawnv(&id, cmd, (const char * const *) args); 170 169 if (rc != EOK) { 171 170 printf("%s: Error spawning %s (%s)\n", APP_NAME, cmd, … … 176 175 task_exit_t texit; 177 176 int retval; 178 rc = task_wait( &twait, &texit, &retval);177 rc = task_wait(id, &texit, &retval); 179 178 if (rc != EOK) { 180 179 printf("%s: Error waiting for %s (%s)\n", APP_NAME, cmd, -
uspace/app/init/init.c
r613d644 rcb1fd3e 172 172 va_start(ap, path); 173 173 task_id_t id; 174 task_wait_t wait; 175 int rc = task_spawn(&id, &wait, path, cnt, ap); 174 int rc = task_spawn(&id, path, cnt, ap); 176 175 va_end(ap); 177 176 … … 190 189 task_exit_t texit; 191 190 int retval; 192 rc = task_wait( &wait, &texit, &retval);191 rc = task_wait(id, &texit, &retval); 193 192 if (rc != EOK) { 194 193 printf("%s: Error waiting for %s (%s)\n", NAME, path, … … 254 253 255 254 task_id_t id; 256 task_wait_t wait; 257 int rc = task_spawnl(&id, &wait, app, app, winreg, NULL); 255 int rc = task_spawnl(&id, app, app, winreg, NULL); 258 256 if (rc != EOK) { 259 257 printf("%s: Error spawning %s %s (%s)\n", NAME, app, … … 264 262 task_exit_t texit; 265 263 int retval; 266 rc = task_wait( &wait, &texit, &retval);264 rc = task_wait(id, &texit, &retval); 267 265 if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) { 268 266 printf("%s: Error retrieving retval from %s (%s)\n", NAME, … … 280 278 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 281 279 282 int rc = task_spawnl(NULL, NULL,APP_GETTERM, APP_GETTERM, svc,280 int rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, svc, 283 281 LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL); 284 282 if (rc != EOK) … … 289 287 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 290 288 291 int rc = task_spawnl(NULL, NULL,APP_GETTERM, APP_GETTERM, svc,289 int rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, svc, 292 290 LOCFS_MOUNT_POINT, "--wait", "--", app, NULL); 293 291 if (rc != EOK) -
uspace/app/redir/redir.c
r613d644 rcb1fd3e 75 75 } 76 76 77 static task_id_t spawn( task_wait_t *wait,int argc, char *argv[])77 static task_id_t spawn(int argc, char *argv[]) 78 78 { 79 79 const char **args; … … 93 93 args[argc] = NULL; 94 94 95 rc = task_spawnv(&id, wait,argv[0], args);95 rc = task_spawnv(&id, argv[0], args); 96 96 97 97 free(args); … … 152 152 */ 153 153 setvbuf(stdout, NULL, _IOLBF, BUFSIZ); 154 155 task_wait_t wait; 156 task_id_t id = spawn(&wait, argc - i, argv + i); 154 155 task_id_t id = spawn(argc - i, argv + i); 157 156 158 157 if (id != 0) { 159 158 task_exit_t texit; 160 159 int retval; 161 task_wait( &wait, &texit, &retval);160 task_wait(id, &texit, &retval); 162 161 163 162 return retval; -
uspace/app/sbi/src/os/helenos.c
r613d644 rcb1fd3e 250 250 { 251 251 task_id_t tid; 252 task_wait_t twait;253 252 task_exit_t texit; 254 253 int rc, retval; 255 254 256 rc = task_spawnv(&tid, &twait,cmd[0], (char const * const *) cmd);255 rc = task_spawnv(&tid, cmd[0], (char const * const *) cmd); 257 256 if (rc != EOK) { 258 257 printf("Error: Failed spawning '%s' (%s).\n", cmd[0], … … 262 261 263 262 /* XXX Handle exit status and return value. */ 264 rc = task_wait( &twait, &texit, &retval);263 rc = task_wait(tid, &texit, &retval); 265 264 (void) rc; 266 265 -
uspace/app/trace/trace.c
r613d644 rcb1fd3e 876 876 printf("Waiting for task to exit.\n"); 877 877 878 rc = task_wait _task_id(task_id, &texit, &retval);878 rc = task_wait(task_id, &texit, &retval); 879 879 if (rc != EOK) { 880 880 printf("Failed waiting for task.\n"); -
uspace/app/viewer/viewer.c
r613d644 rcb1fd3e 44 44 #include <surface.h> 45 45 #include <codec/tga.h> 46 #include <task.h>47 46 48 47 #define NAME "viewer" -
uspace/app/vlaunch/vlaunch.c
r613d644 rcb1fd3e 94 94 95 95 task_id_t id; 96 task_wait_t wait; 97 int rc = task_spawnl(&id, &wait, app, app, winreg, NULL); 96 int rc = task_spawnl(&id, app, app, winreg, NULL); 98 97 if (rc != EOK) { 99 98 printf("%s: Error spawning %s %s (%s)\n", NAME, app, … … 104 103 task_exit_t texit; 105 104 int retval; 106 rc = task_wait( &wait, &texit, &retval);105 rc = task_wait(id, &texit, &retval); 107 106 if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) { 108 107 printf("%s: Error retrieving retval from %s (%s)\n", NAME, -
uspace/lib/c/generic/task.c
r613d644 rcb1fd3e 2 2 * Copyright (c) 2006 Jakub Jermar 3 3 * Copyright (c) 2008 Jiri Svoboda 4 * Copyright (c) 2014 Martin Sucha5 4 * All rights reserved. 6 5 * … … 95 94 * 96 95 * @param id If not NULL, the ID of the task is stored here on success. 97 * @param wait If not NULL, setup waiting for task's return value and store98 * the information necessary for waiting here on success.99 96 * @param path Pathname of the binary to execute. 100 97 * @param argv Command-line arguments. … … 103 100 * 104 101 */ 105 int task_spawnv(task_id_t *id, task_wait_t *wait, const char *path, 106 const char *const args[]) 102 int task_spawnv(task_id_t *id, const char *path, const char *const args[]) 107 103 { 108 104 /* Send default files */ … … 129 125 files[3] = NULL; 130 126 131 return task_spawnvf(id, wait,path, args, files);127 return task_spawnvf(id, path, args, files); 132 128 } 133 129 … … 139 135 * 140 136 * @param id If not NULL, the ID of the task is stored here on success. 141 * @param wait If not NULL, setup waiting for task's return value and store142 * the information necessary for waiting here on success.143 137 * @param path Pathname of the binary to execute. 144 138 * @param argv Command-line arguments. … … 148 142 * 149 143 */ 150 int task_spawnvf(task_id_t *id, task_wait_t *wait, const char *path,151 const char *const args[],int *const files[])144 int task_spawnvf(task_id_t *id, const char *path, const char *const args[], 145 int *const files[]) 152 146 { 153 147 /* Connect to a program loader. */ … … 156 150 return EREFUSED; 157 151 158 bool wait_initialized = false;159 160 152 /* Get task ID. */ 161 153 task_id_t task_id; … … 189 181 goto error; 190 182 191 /* Setup waiting for return value if needed */192 if (wait) {193 rc = task_setup_wait(task_id, wait);194 if (rc != EOK)195 goto error;196 wait_initialized = true;197 }198 199 183 /* Run it. */ 200 184 rc = loader_run(ldr); … … 209 193 210 194 error: 211 if (wait_initialized)212 task_cancel_wait(wait);213 214 195 /* Error exit */ 215 196 loader_abort(ldr); … … 223 204 * 224 205 * @param id If not NULL, the ID of the task is stored here on success. 225 * @param wait If not NULL, setup waiting for task's return value and store226 * the information necessary for waiting here on success.227 206 * @param path Pathname of the binary to execute. 228 207 * @param cnt Number of arguments. … … 232 211 * 233 212 */ 234 int task_spawn(task_id_t *task_id, task_wait_t *wait, const char *path, 235 int cnt, va_list ap) 213 int task_spawn(task_id_t *task_id, const char *path, int cnt, va_list ap) 236 214 { 237 215 /* Allocate argument list. */ … … 249 227 250 228 /* Spawn task. */ 251 int rc = task_spawnv(task_id, wait,path, arglist);229 int rc = task_spawnv(task_id, path, arglist); 252 230 253 231 /* Free argument list. */ … … 262 240 * 263 241 * @param id If not NULL, the ID of the task is stored here on success. 264 * @param wait If not NULL, setup waiting for task's return value and store265 * the information necessary for waiting here on success.266 242 * @param path Pathname of the binary to execute. 267 243 * @param ... Command-line arguments. … … 270 246 * 271 247 */ 272 int task_spawnl(task_id_t *task_id, task_wait_t *wait,const char *path, ...)248 int task_spawnl(task_id_t *task_id, const char *path, ...) 273 249 { 274 250 /* Count the number of arguments. */ … … 286 262 287 263 va_start(ap, path); 288 int rc = task_spawn(task_id, wait,path, cnt, ap);264 int rc = task_spawn(task_id, path, cnt, ap); 289 265 va_end(ap); 290 266 … … 292 268 } 293 269 294 /** Setup waiting for a task. 295 * 296 * If the task finishes after this call succeeds, it is guaranteed that 297 * task_wait(wait, &texit, &retval) will return correct return value for 298 * the task. 299 * 300 * @param id ID of the task to setup waiting for. 301 * @param wait Information necessary for the later task_wait call is stored here. 302 * 303 * @return EOK on success, else error code. 304 */ 305 int task_setup_wait(task_id_t id, task_wait_t *wait) 306 { 307 async_exch_t *exch = async_exchange_begin(session_ns); 308 wait->aid = async_send_2(exch, NS_TASK_WAIT, LOWER32(id), UPPER32(id), 309 &wait->result); 310 async_exchange_end(exch); 311 312 return EOK; 313 } 314 315 /** Cancel waiting for a task. 316 * 317 * This can be called *instead of* task_wait if the caller is not interested 318 * in waiting for the task anymore. 319 * 320 * This function cannot be called if the task_wait was already called. 321 * 322 * @param wait task_wait_t previously initialized by task_setup_wait. 323 */ 324 void task_cancel_wait(task_wait_t *wait) { 325 async_forget(wait->aid); 326 } 327 328 /** Wait for a task to finish. 329 * 330 * This function returns correct values even if the task finished in 331 * between task_setup_wait and this task_wait call. 332 * 333 * This function cannot be called more than once with the same task_wait_t 334 * (it can be reused, but must be reinitialized with task_setup_wait first) 335 * 336 * @param wait task_wait_t previously initialized by task_setup_wait. 337 * @param texit Store type of task exit here. 338 * @param retval Store return value of the task here. 339 * 340 * @return EOK on success, else error code. 341 */ 342 int task_wait(task_wait_t *wait, task_exit_t *texit, int *retval) 270 int task_wait(task_id_t id, task_exit_t *texit, int *retval) 343 271 { 344 272 assert(texit); 345 273 assert(retval); 346 347 sysarg_t rc; 348 async_wait_for(wait->aid, &rc); 349 350 if (rc == EOK) { 351 *texit = IPC_GET_ARG1(wait->result); 352 *retval = IPC_GET_ARG2(wait->result); 353 } 354 355 return rc; 356 } 357 358 /** Wait for a task to finish by its id. 359 * 360 * Note that this will fail with ENOENT if the task id is not registered in ns 361 * (e.g. if the task finished). If you are spawning a task and need to wait 362 * for its completion, use wait parameter of the task_spawn* functions instead 363 * to prevent a race where the task exits before you may have a chance to wait 364 * wait for it. 365 * 366 * @param id ID of the task to wait for. 367 * @param texit Store type of task exit here. 368 * @param retval Store return value of the task here. 369 * 370 * @return EOK on success, else error code. 371 */ 372 int task_wait_task_id(task_id_t id, task_exit_t *texit, int *retval) 373 { 374 task_wait_t wait; 375 int rc = task_setup_wait(id, &wait); 376 if (rc != EOK) 377 return rc; 378 379 return task_wait(&wait, texit, retval); 274 275 async_exch_t *exch = async_exchange_begin(session_ns); 276 sysarg_t te, rv; 277 int rc = (int) async_req_2_2(exch, NS_TASK_WAIT, LOWER32(id), 278 UPPER32(id), &te, &rv); 279 async_exchange_end(exch); 280 281 *texit = te; 282 *retval = rv; 283 284 return rc; 380 285 } 381 286 -
uspace/lib/c/include/async.h
r613d644 rcb1fd3e 45 45 #include <atomic.h> 46 46 #include <stdbool.h> 47 #include < abi/proc/task.h>47 #include <task.h> 48 48 #include <abi/ddi/irq.h> 49 49 #include <abi/ipc/event.h> -
uspace/lib/c/include/ipc/common.h
r613d644 rcb1fd3e 39 39 #include <abi/ipc/ipc.h> 40 40 #include <atomic.h> 41 #include < abi/proc/task.h>41 #include <task.h> 42 42 43 43 #define IPC_FLAG_BLOCKING 0x01 -
uspace/lib/c/include/ipc/ipc.h
r613d644 rcb1fd3e 44 44 #include <abi/ipc/methods.h> 45 45 #include <abi/synch.h> 46 #include < abi/proc/task.h>46 #include <task.h> 47 47 48 48 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *); -
uspace/lib/c/include/loader/loader.h
r613d644 rcb1fd3e 37 37 #define LIBC_LOADER_H_ 38 38 39 #include < abi/proc/task.h>39 #include <task.h> 40 40 41 41 /** Forward declararion */ -
uspace/lib/c/include/task.h
r613d644 rcb1fd3e 39 39 #include <abi/proc/task.h> 40 40 #include <stdarg.h> 41 #include <async.h>42 #include <types/task.h>43 41 44 typedef struct { 45 ipc_call_t result; 46 aid_t aid; 47 } task_wait_t; 48 49 struct _TASK; 50 typedef struct _TASK task_t; 42 typedef enum { 43 TASK_EXIT_NORMAL, 44 TASK_EXIT_UNEXPECTED 45 } task_exit_t; 51 46 52 47 extern task_id_t task_get_id(void); … … 54 49 extern int task_kill(task_id_t); 55 50 56 extern int task_spawnv(task_id_t *, task_wait_t *, const char *path, 57 const char *const []); 58 extern int task_spawnvf(task_id_t *, task_wait_t *, const char *path, 59 const char *const [], int *const []); 60 extern int task_spawn(task_id_t *, task_wait_t *, const char *path, int, 61 va_list ap); 62 extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...); 51 extern int task_spawnv(task_id_t *, const char *path, const char *const []); 52 extern int task_spawnvf(task_id_t *, const char *path, const char *const [], 53 int *const []); 54 extern int task_spawn(task_id_t *, const char *path, int, va_list ap); 55 extern int task_spawnl(task_id_t *, const char *path, ...); 63 56 64 extern int task_setup_wait(task_id_t, task_wait_t *); 65 extern void task_cancel_wait(task_wait_t *); 66 extern int task_wait(task_wait_t *, task_exit_t *, int *); 67 extern int task_wait_task_id(task_id_t, task_exit_t *, int *); 57 extern int task_wait(task_id_t id, task_exit_t *, int *); 68 58 extern int task_retval(int); 69 59 -
uspace/lib/gui/terminal.c
r613d644 rcb1fd3e 104 104 static void getterm(const char *svc, const char *app) 105 105 { 106 task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc,107 LOCFS_MOUNT_POINT,"--msg", "--wait", "--", app, NULL);106 task_spawnl(NULL, APP_GETTERM, APP_GETTERM, svc, LOCFS_MOUNT_POINT, 107 "--msg", "--wait", "--", app, NULL); 108 108 } 109 109 -
uspace/lib/hound/src/client.c
r613d644 rcb1fd3e 42 42 #include <stdio.h> 43 43 #include <libarch/types.h> 44 #include <task.h>45 44 46 45 #include "protocol.h" -
uspace/lib/posix/source/sys/wait.c
r613d644 rcb1fd3e 100 100 int retval; 101 101 102 int rc = task_wait _task_id((task_id_t) pid, &texit, &retval);102 int rc = task_wait((task_id_t) pid, &texit, &retval); 103 103 104 104 if (rc < 0) { -
uspace/srv/audio/hound/main.c
r613d644 rcb1fd3e 43 43 #include <hound/server.h> 44 44 #include <hound/protocol.h> 45 #include <task.h>46 45 47 46 #include "hound.h" -
uspace/srv/bd/sata_bd/sata_bd.c
r613d644 rcb1fd3e 45 45 #include <loc.h> 46 46 #include <macros.h> 47 #include <task.h>48 47 49 48 #include <ahci_iface.h> -
uspace/srv/devman/driver.c
r613d644 rcb1fd3e 40 40 #include <str_error.h> 41 41 #include <stdio.h> 42 #include <task.h>43 42 44 43 #include "dev.h" … … 291 290 log_msg(LOG_DEFAULT, LVL_DEBUG, "start_driver(drv=\"%s\")", drv->name); 292 291 293 rc = task_spawnl(NULL, NULL,drv->binary_path, drv->binary_path, NULL);292 rc = task_spawnl(NULL, drv->binary_path, drv->binary_path, NULL); 294 293 if (rc != EOK) { 295 294 log_msg(LOG_DEFAULT, LVL_ERROR, "Spawning driver `%s' (%s) failed: %s.", -
uspace/srv/hid/isdv4_tablet/main.c
r613d644 rcb1fd3e 36 36 #include <ipc/mouseev.h> 37 37 #include <inttypes.h> 38 #include <task.h>39 38 40 39 #include "isdv4.h" -
uspace/srv/hid/remcons/remcons.c
r613d644 rcb1fd3e 226 226 227 227 task_id_t task; 228 task_wait_t wait; 229 int rc = task_spawnl(&task, &wait, APP_GETTERM, APP_GETTERM, user->service_name, 228 int rc = task_spawnl(&task, APP_GETTERM, APP_GETTERM, user->service_name, 230 229 "/loc", "--msg", "--", APP_SHELL, NULL); 231 230 if (rc != EOK) { … … 247 246 task_exit_t task_exit; 248 247 int task_retval; 249 task_wait( &wait, &task_exit, &task_retval);248 task_wait(task, &task_exit, &task_retval); 250 249 telnet_user_log(user, "%s terminated %s, exit code %d.", APP_GETTERM, 251 250 task_exit == TASK_EXIT_NORMAL ? "normally" : "unexpectedly", -
uspace/srv/hid/rfb/main.c
r613d644 rcb1fd3e 35 35 #include <inttypes.h> 36 36 #include <io/log.h> 37 #include <task.h>38 37 39 38 #include <abi/fb/visuals.h> -
uspace/srv/net/ethip/ethip.c
r613d644 rcb1fd3e 44 44 #include <stdio.h> 45 45 #include <stdlib.h> 46 #include <task.h>47 46 #include "arp.h" 48 47 #include "ethip.h" -
uspace/srv/net/inetsrv/inetsrv.c
r613d644 rcb1fd3e 46 46 #include <stdlib.h> 47 47 #include <sys/types.h> 48 #include <task.h>49 48 #include "addrobj.h" 50 49 #include "icmp.h" -
uspace/srv/net/loopip/loopip.c
r613d644 rcb1fd3e 44 44 #include <stdio.h> 45 45 #include <stdlib.h> 46 #include <task.h>47 46 48 47 #define NAME "loopip" -
uspace/srv/net/nconfsrv/nconfsrv.c
r613d644 rcb1fd3e 48 48 #include <stdlib.h> 49 49 #include <sys/types.h> 50 #include <task.h>51 50 #include "iplink.h" 52 51 #include "nconfsrv.h" -
uspace/srv/net/slip/slip.c
r613d644 rcb1fd3e 43 43 #include <io/log.h> 44 44 #include <errno.h> 45 #include <task.h>46 45 47 46 #define NAME "slip" -
uspace/srv/ns/ns.c
r613d644 rcb1fd3e 66 66 while (true) { 67 67 process_pending_conn(); 68 process_pending_wait(); 68 69 69 70 ipc_call_t call; -
uspace/srv/ns/task.c
r613d644 rcb1fd3e 40 40 #include <macros.h> 41 41 #include <malloc.h> 42 #include <types/task.h>43 42 #include "task.h" 44 43 #include "ns.h" 45 44 45 46 /* TODO: 47 * 48 * As there is currently no convention that each task has to be waited 49 * for, the NS can leak memory because of the zombie tasks. 50 * 51 */ 46 52 47 53 /** Task hash table item. */ … … 189 195 } 190 196 197 hash_table_remove(&task_hash_table, &pr->id); 191 198 list_remove(&pr->link); 192 199 free(pr); … … 197 204 void wait_for_task(task_id_t id, ipc_call_t *call, ipc_callid_t callid) 198 205 { 206 sysarg_t retval; 207 task_exit_t texit; 208 bool remove = false; 209 199 210 ht_link_t *link = hash_table_find(&task_hash_table, &id); 200 211 hashed_task_t *ht = (link != NULL) ? … … 207 218 } 208 219 209 if (ht->finished) { 210 task_exit_t texit = ht->have_rval ? TASK_EXIT_NORMAL : 211 TASK_EXIT_UNEXPECTED; 212 ipc_answer_2(callid, EOK, texit, ht->retval); 220 if (!ht->finished) { 221 /* Add to pending list */ 222 pending_wait_t *pr = 223 (pending_wait_t *) malloc(sizeof(pending_wait_t)); 224 if (!pr) { 225 retval = ENOMEM; 226 goto out; 227 } 228 229 link_initialize(&pr->link); 230 pr->id = id; 231 pr->callid = callid; 232 list_append(&pr->link, &pending_wait); 213 233 return; 214 234 } 215 235 216 /* Add to pending list */ 217 pending_wait_t *pr = 218 (pending_wait_t *) malloc(sizeof(pending_wait_t)); 219 if (!pr) { 220 if (!(callid & IPC_CALLID_NOTIFICATION)) 221 ipc_answer_0(callid, ENOMEM); 222 return; 223 } 224 225 link_initialize(&pr->link); 226 pr->id = id; 227 pr->callid = callid; 228 list_append(&pr->link, &pending_wait); 236 remove = true; 237 retval = EOK; 238 239 out: 240 if (!(callid & IPC_CALLID_NOTIFICATION)) { 241 texit = ht->have_rval ? TASK_EXIT_NORMAL : TASK_EXIT_UNEXPECTED; 242 ipc_answer_2(callid, retval, texit, ht->retval); 243 } 244 if (remove) 245 hash_table_remove_item(&task_hash_table, link); 229 246 } 230 247 … … 297 314 ht->retval = IPC_GET_ARG1(*call); 298 315 299 process_pending_wait();300 301 316 return EOK; 302 317 } … … 321 336 ht->finished = true; 322 337 323 process_pending_wait();324 hash_table_remove(&task_hash_table, &id);325 326 338 return EOK; 327 339 } -
uspace/srv/ns/task.h
r613d644 rcb1fd3e 35 35 36 36 #include <ipc/common.h> 37 #include < abi/proc/task.h>37 #include <task.h> 38 38 39 39 extern int task_init(void); -
uspace/srv/taskmon/taskmon.c
r613d644 rcb1fd3e 82 82 83 83 printf(NAME ": Executing %s -c %s -t %s\n", fname, dump_fname, s_taskid); 84 rc = task_spawnl(NULL, NULL,fname, fname, "-c", dump_fname, "-t", s_taskid,84 rc = task_spawnl(NULL, fname, fname, "-c", dump_fname, "-t", s_taskid, 85 85 NULL); 86 86 } else { 87 87 printf(NAME ": Executing %s -t %s\n", fname, s_taskid); 88 rc = task_spawnl(NULL, NULL,fname, fname, "-t", s_taskid, NULL);88 rc = task_spawnl(NULL, fname, fname, "-t", s_taskid, NULL); 89 89 } 90 90
Note:
See TracChangeset
for help on using the changeset viewer.
