Changeset 0182a665 in mainline for generic/src/proc/thread.c
- Timestamp:
- 2006-06-10T13:40:53Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8060a24c
- Parents:
- 971cf31f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/proc/thread.c
r971cf31f r0182a665 351 351 * Attach to the containing task. 352 352 */ 353 ipl = interrupts_disable(); 353 354 spinlock_lock(&task->lock); 354 355 if (!task->accept_new_threads) { 355 356 spinlock_unlock(&task->lock); 356 357 slab_free(thread_slab, t); 358 interrupts_restore(ipl); 357 359 return NULL; 358 360 } … … 365 367 * Register this thread in the system-wide list. 366 368 */ 367 ipl = interrupts_disable();368 369 spinlock_lock(&threads_lock); 369 370 btree_insert(&threads_btree, (btree_key_t) ((__address) t), (void *) t, NULL); … … 375 376 } 376 377 377 /** Make thread exiting378 /** Terminate thread. 378 379 * 379 380 * End current thread execution and switch it to the exiting … … 438 439 ipl = interrupts_disable(); 439 440 spinlock_lock(&t->lock); 440 441 441 ASSERT(!t->detached); 442 443 (void) waitq_sleep_prepare(&t->join_wq);444 442 spinlock_unlock(&t->lock); 445 446 rc = waitq_sleep_timeout_unsafe(&t->join_wq, usec, flags); 447 448 waitq_sleep_finish(&t->join_wq, rc, ipl); 449 interrupts_restore(ipl); 443 interrupts_restore(ipl); 444 445 rc = waitq_sleep_timeout(&t->join_wq, usec, flags); 450 446 451 447 return rc; … … 467 463 * pointer to it must be still valid. 468 464 */ 469 470 465 ipl = interrupts_disable(); 471 466 spinlock_lock(&t->lock);
Note:
See TracChangeset
for help on using the changeset viewer.