thr_sig.c (37045) | thr_sig.c (38539) |
---|---|
1/* 2 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 198 unchanged lines hidden (view full) --- 207 * signals: 208 */ 209 for (pthread = _thread_link_list; 210 pthread != NULL; 211 pthread = pthread->nxt) 212 sigdelset(&pthread->sigpend,SIGCONT); 213 } 214 | 1/* 2 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 198 unchanged lines hidden (view full) --- 207 * signals: 208 */ 209 for (pthread = _thread_link_list; 210 pthread != NULL; 211 pthread = pthread->nxt) 212 sigdelset(&pthread->sigpend,SIGCONT); 213 } 214 |
215 /* 216 * Enter a loop to process each thread in the linked 217 * list that is sigwait-ing on a signal. Since POSIX 218 * doesn't specify which thread will get the signal 219 * if there are multiple waiters, we'll give it to the 220 * first one we find. 221 */ 222 for (pthread = _thread_link_list; pthread != NULL; 223 pthread = pthread->nxt) { 224 if ((pthread->state == PS_SIGWAIT) && 225 sigismember(&pthread->sigmask, sig)) { 226 /* Change the state of the thread to run: */ 227 PTHREAD_NEW_STATE(pthread,PS_RUNNING); 228 229 /* Return the signal number: */ 230 pthread->signo = sig; 231 232 /* 233 * Do not attempt to deliver this signal 234 * to other threads. 235 */ 236 return; 237 } 238 } 239 |
|
215 /* Check if the signal is not being ignored: */ 216 if (_thread_sigact[sig - 1].sa_handler != SIG_IGN) 217 /* 218 * Enter a loop to process each thread in the linked 219 * list: 220 */ 221 for (pthread = _thread_link_list; pthread != NULL; 222 pthread = pthread->nxt) --- 31 unchanged lines hidden (view full) --- 254 case PS_FDLR_WAIT: 255 case PS_FDLW_WAIT: 256 case PS_FILE_WAIT: 257 case PS_JOIN: 258 case PS_MUTEX_WAIT: 259 case PS_RUNNING: 260 case PS_STATE_MAX: 261 case PS_SIGTHREAD: | 240 /* Check if the signal is not being ignored: */ 241 if (_thread_sigact[sig - 1].sa_handler != SIG_IGN) 242 /* 243 * Enter a loop to process each thread in the linked 244 * list: 245 */ 246 for (pthread = _thread_link_list; pthread != NULL; 247 pthread = pthread->nxt) --- 31 unchanged lines hidden (view full) --- 279 case PS_FDLR_WAIT: 280 case PS_FDLW_WAIT: 281 case PS_FILE_WAIT: 282 case PS_JOIN: 283 case PS_MUTEX_WAIT: 284 case PS_RUNNING: 285 case PS_STATE_MAX: 286 case PS_SIGTHREAD: |
287 case PS_SIGWAIT: |
|
262 case PS_SUSPENDED: 263 /* Nothing to do here. */ 264 break; 265 266 /* 267 * The wait state is a special case due to the handling of 268 * SIGCHLD signals. 269 */ --- 15 unchanged lines hidden (view full) --- 285 286 /* 287 * States that are interrupted by the occurrence of a signal 288 * other than the scheduling alarm: 289 */ 290 case PS_FDR_WAIT: 291 case PS_FDW_WAIT: 292 case PS_SLEEP_WAIT: | 288 case PS_SUSPENDED: 289 /* Nothing to do here. */ 290 break; 291 292 /* 293 * The wait state is a special case due to the handling of 294 * SIGCHLD signals. 295 */ --- 15 unchanged lines hidden (view full) --- 311 312 /* 313 * States that are interrupted by the occurrence of a signal 314 * other than the scheduling alarm: 315 */ 316 case PS_FDR_WAIT: 317 case PS_FDW_WAIT: 318 case PS_SLEEP_WAIT: |
293 case PS_SIGWAIT: | |
294 case PS_SELECT_WAIT: 295 if (sig != SIGCHLD || 296 _thread_sigact[sig - 1].sa_handler != SIG_DFL) { 297 /* Flag the operation as interrupted: */ 298 pthread->interrupted = 1; 299 300 /* Change the state of the thread to run: */ 301 PTHREAD_NEW_STATE(pthread,PS_RUNNING); --- 40 unchanged lines hidden --- | 319 case PS_SELECT_WAIT: 320 if (sig != SIGCHLD || 321 _thread_sigact[sig - 1].sa_handler != SIG_DFL) { 322 /* Flag the operation as interrupted: */ 323 pthread->interrupted = 1; 324 325 /* Change the state of the thread to run: */ 326 PTHREAD_NEW_STATE(pthread,PS_RUNNING); --- 40 unchanged lines hidden --- |