Changeset adb49f58 in mainline for uspace/srv
- Timestamp:
- 2009-07-06T20:16:15Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 95bc57c
- Parents:
- 0315679
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/task.c
r0315679 radb49f58 57 57 typedef struct { 58 58 link_t link; 59 task_id_t id; /**< Task ID. */ 60 int retval; 61 bool destroyed; 59 task_id_t id; /**< Task ID. */ 60 bool finished; /**< Task is done. */ 61 bool have_rval; /**< Task returned a value. */ 62 int retval; /**< The return value. */ 62 63 } hashed_task_t; 63 64 … … 212 213 { 213 214 link_t *cur; 215 task_exit_t texit; 214 216 215 217 loop: … … 227 229 228 230 hashed_task_t *ht = hash_table_get_instance(link, hashed_task_t, link); 229 if (!ht-> destroyed)231 if (!ht->finished) 230 232 continue; 231 233 232 if (!(pr->callid & IPC_CALLID_NOTIFICATION)) 233 ipc_answer_1(pr->callid, EOK, ht->retval); 234 234 if (!(pr->callid & IPC_CALLID_NOTIFICATION)) { 235 texit = ht->have_rval ? TASK_EXIT_NORMAL : 236 TASK_EXIT_UNEXPECTED; 237 ipc_answer_2(pr->callid, EOK, texit, 238 ht->retval); 239 } 240 235 241 hash_table_remove(&task_hash_table, keys, 2); 236 242 list_remove(cur); … … 243 249 { 244 250 ipcarg_t retval; 251 task_exit_t texit; 252 245 253 unsigned long keys[2] = { 246 254 LOWER32(id), … … 258 266 } 259 267 260 if (!ht-> destroyed) {268 if (!ht->finished) { 261 269 /* Add to pending list */ 262 270 pending_wait_t *pr = … … 277 285 278 286 out: 279 if (!(callid & IPC_CALLID_NOTIFICATION)) 280 ipc_answer_1(callid, retval, ht->retval); 287 if (!(callid & IPC_CALLID_NOTIFICATION)) { 288 texit = ht->have_rval ? TASK_EXIT_NORMAL : TASK_EXIT_UNEXPECTED; 289 ipc_answer_2(callid, retval, texit, ht->retval); 290 } 281 291 } 282 292 … … 319 329 link_initialize(&ht->link); 320 330 ht->id = id; 321 ht->destroyed = false; 331 ht->finished = false; 332 ht->have_rval = false; 322 333 ht->retval = -1; 323 334 hash_table_insert(&task_hash_table, keys, &ht->link); … … 343 354 hash_table_get_instance(link, hashed_task_t, link) : NULL; 344 355 345 if ((ht == NULL) || ht-> destroyed)356 if ((ht == NULL) || ht->finished) 346 357 return EINVAL; 347 358 359 ht->finished = true; 360 ht->have_rval = true; 348 361 ht->retval = IPC_GET_ARG1(*call); 349 362 … … 372 385 hashed_task_t *ht = 373 386 hash_table_get_instance(link, hashed_task_t, link); 374 assert(ht != NULL); 375 376 ht->destroyed = true; 387 if (ht == NULL) 388 return EOK; 389 390 ht->finished = true; 377 391 378 392 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.