Deleted Added
full compact
thr_kill.c (35509) thr_kill.c (38539)
1/*
2 * Copyright (c) 1997 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

--- 33 unchanged lines hidden (view full) ---

42 int ret;
43
44 /* Check for invalid signal numbers: */
45 if (sig < 0 || sig >= NSIG)
46 /* Invalid signal: */
47 ret = EINVAL;
48
49 /* Find the thread in the list of active threads: */
1/*
2 * Copyright (c) 1997 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

--- 33 unchanged lines hidden (view full) ---

42 int ret;
43
44 /* Check for invalid signal numbers: */
45 if (sig < 0 || sig >= NSIG)
46 /* Invalid signal: */
47 ret = EINVAL;
48
49 /* Find the thread in the list of active threads: */
50 else if ((ret = _find_thread(pthread)) == 0)
51 /* Increment the pending signal count: */
52 sigaddset(&pthread->sigpend,sig);
50 else if ((ret = _find_thread(pthread)) == 0) {
51 if ((pthread->state == PS_SIGWAIT) &&
52 sigismember(&pthread->sigmask, sig)) {
53 /* Change the state of the thread to run: */
54 PTHREAD_NEW_STATE(pthread,PS_RUNNING);
53
55
56 /* Return the signal number: */
57 pthread->signo = sig;
58 } else
59 /* Increment the pending signal count: */
60 sigaddset(&pthread->sigpend,sig);
61 }
62
54 /* Return the completion status: */
55 return (ret);
56}
57#endif
63 /* Return the completion status: */
64 return (ret);
65}
66#endif