5.3.3 Testing for the Termination Flag
The following code shows how the el_autosense_thread( ) routine tests for the termination flag:
while
1
printf("el%d: Autosense thread exiting\n",
thread_halt_self();
}
2
1
2
Performs an initial test for the termination flag. The termination flag would have been set if another kernel thread had called the thread_terminate( ) routine for the el_autosense_thread( ) routine.
The thread_halt_self( ) routine performs the work that is associated with a variety of asynchronous traps (ASTs) for a kernel thread that terminates itself. A kernel thread terminates itself by calling the thread_halt_self( ) routine. The thread_halt_self( ) routine does not return to the caller.
5.3.4 Starting Up Statistics
The following code shows how the el_autosense_thread( ) routine starts up statistics:
s = splimp();
1
1
Starts up statistics to test for the loss of the carrier during the transmit operation.
5.3.5 Entering the Packet Transmit Loop
The following code shows how the el_autosense_thread( ) routine enters the packet transmit loop:
good_xmits = passes = 0; 1
while