Deleted Added
full compact
thr_join.c (22315) thr_join.c (31402)
1/*
2 * Copyright (c) 1995 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

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

62 while (pthread1 != NULL && pthread1 != pthread) {
63 /* Point to the next thread: */
64 pthread1 = pthread1->nxt;
65 }
66 }
67
68 if (pthread1 == NULL) {
69 /* Return an error: */
1/*
2 * Copyright (c) 1995 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

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

62 while (pthread1 != NULL && pthread1 != pthread) {
63 /* Point to the next thread: */
64 pthread1 = pthread1->nxt;
65 }
66 }
67
68 if (pthread1 == NULL) {
69 /* Return an error: */
70 errno = ESRCH;
71 rval = -1;
70 rval = ESRCH;
72
73 /* Check if this thread has been detached: */
74 } else if ((pthread->attr.flags & PTHREAD_DETACHED) != 0) {
75 /* Return an error: */
71
72 /* Check if this thread has been detached: */
73 } else if ((pthread->attr.flags & PTHREAD_DETACHED) != 0) {
74 /* Return an error: */
76 errno = ESRCH;
77 rval = -1;
75 rval = ESRCH;
78 }
79 /* Check if the thread is not dead: */
80 else if (pthread->state != PS_DEAD) {
81 /* Add the running thread to the join queue: */
82 _thread_queue_enq(&(pthread->join_queue), _thread_run);
83
84 /* Schedule the next thread: */
85 _thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__);

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

91 if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) {
92 /* Check if the return value is required: */
93 if (thread_return) {
94 /* Return the thread's return value: */
95 *thread_return = pthread->ret;
96 }
97 } else {
98 /* Return an error: */
76 }
77 /* Check if the thread is not dead: */
78 else if (pthread->state != PS_DEAD) {
79 /* Add the running thread to the join queue: */
80 _thread_queue_enq(&(pthread->join_queue), _thread_run);
81
82 /* Schedule the next thread: */
83 _thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__);

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

89 if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) {
90 /* Check if the return value is required: */
91 if (thread_return) {
92 /* Return the thread's return value: */
93 *thread_return = pthread->ret;
94 }
95 } else {
96 /* Return an error: */
99 errno = ESRCH;
100 rval = -1;
97 rval = ESRCH;
101 }
102 } else {
103 /* Check if the return value is required: */
104 if (thread_return != NULL) {
105 /* Return the thread's return value: */
106 *thread_return = pthread->ret;
107 }
108 }
109
110 /* Unblock signals: */
111 _thread_kern_sig_unblock(status);
112
113 /* Return the completion status: */
114 return (rval);
115}
116#endif
98 }
99 } else {
100 /* Check if the return value is required: */
101 if (thread_return != NULL) {
102 /* Return the thread's return value: */
103 *thread_return = pthread->ret;
104 }
105 }
106
107 /* Unblock signals: */
108 _thread_kern_sig_unblock(status);
109
110 /* Return the completion status: */
111 return (rval);
112}
113#endif