Changeset 12799
- Timestamp:
- Sep 9, 2009, 8:11:16 AM (15 years ago)
- Location:
- branches/working-0711/ccl
- Files:
-
- 3 edited
-
level-1/l1-lisp-threads.lisp (modified) (3 diffs)
-
level-1/l1-processes.lisp (modified) (3 diffs)
-
lisp-kernel/thread_manager.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/level-1/l1-lisp-threads.lisp
r12408 r12799 485 485 ;;; This doesn't quite activate the thread; see PROCESS-TCR-ENABLE. 486 486 (defun %activate-tcr (tcr termination-semaphore allocation-quantum) 487 (declare (ignore termination-semaphore)) 487 488 (if (and tcr (not (eql 0 tcr))) 488 489 (with-macptrs (tcrp) … … 490 491 (setf (%get-natural tcrp target::tcr.log2-allocation-quantum) 491 492 (or allocation-quantum (default-allocation-quantum))) 492 (setf (%get-ptr tcrp target::tcr.termination-semaphore)493 (if termination-semaphore494 (semaphore-value termination-semaphore)495 (%null-ptr)))496 493 t))) 497 494 … … 1115 1112 (defun %foreign-thread-terminate () 1116 1113 (let* ((proc *current-process*)) 1117 (when proc (remove-from-all-processes proc)))) 1114 (when proc 1115 (remove-from-all-processes proc) 1116 (let* ((ts (process-termination-semaphore proc))) 1117 (when ts (signal-semaphore ts)))))) 1118 -
branches/working-0711/ccl/level-1/l1-processes.lisp
r12224 r12799 319 319 )) 320 320 321 (defmethod (setf process-termination-semaphore) :after (new (p process)) 322 (with-macptrs (tcrp) 323 (%setf-macptr-to-object tcrp (process-tcr p)) 324 (unless (%null-ptr-p tcrp) 325 (setf (%get-ptr tcrp target::tcr.termination-semaphore) 326 (if new 327 (semaphore-value new) 328 (%null-ptr)))) 329 new)) 321 330 322 331 323 (defun process-resume (p) … … 418 410 ;;; Separated from run-process-initial-form just so I can change it easily. 419 411 (defun process-initial-form-exited (process kill) 420 ;; Enter the *initial-process* and have it finish us up421 412 (without-interrupts 422 413 (if (eq kill :shutdown) … … 424 415 (setq *whostate* "Shutdown") 425 416 (add-to-shutdown-processes process))) 417 (let* ((semaphore (process-termination-semaphore process))) 418 (when semaphore (signal-semaphore semaphore))) 426 419 (maybe-finish-process-kill process kill))) 427 420 -
branches/working-0711/ccl/lisp-kernel/thread_manager.c
r12753 r12799 1381 1381 1382 1382 area *vs, *ts, *cs; 1383 void *termination_semaphore;1384 1383 1385 1384 if (current == NULL) { … … 1424 1423 tcr->osid = 0; 1425 1424 tcr->interrupt_pending = 0; 1426 termination_semaphore = tcr->termination_semaphore;1427 1425 tcr->termination_semaphore = NULL; 1428 1426 #ifdef HAVE_TLS … … 1439 1437 #endif 1440 1438 UNLOCK(lisp_global(TCR_AREA_LOCK),current); 1441 if (termination_semaphore) {1442 SEM_RAISE(termination_semaphore);1443 }1444 1439 } else { 1445 1440 tsd_set(lisp_global(TCR_KEY), TCR_TO_TSD(tcr));
Note:
See TracChangeset
for help on using the changeset viewer.
