Deleted Added
full compact
thr_info.c (13546) thr_info.c (22315)
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

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

82
83 /* Enter a loop to report each thread in the global list: */
84 for (pthread = _thread_link_list; pthread != NULL; pthread = pthread->nxt) {
85 /* Find the state: */
86 for (j = 0; j < (sizeof(thread_info) / sizeof(struct s_thread_info)) - 1; j++)
87 if (thread_info[j].state == pthread->state)
88 break;
89 /* Output a record for the current thread: */
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

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

82
83 /* Enter a loop to report each thread in the global list: */
84 for (pthread = _thread_link_list; pthread != NULL; pthread = pthread->nxt) {
85 /* Find the state: */
86 for (j = 0; j < (sizeof(thread_info) / sizeof(struct s_thread_info)) - 1; j++)
87 if (thread_info[j].state == pthread->state)
88 break;
89 /* Output a record for the current thread: */
90 sprintf(s, "--------------------\nThread %p prio %3d state %s\n",
91 pthread, pthread->pthread_priority, thread_info[j].name);
90 sprintf(s, "--------------------\nThread %p prio %3d state %s [%s:%d]\n",
91 pthread, pthread->pthread_priority, thread_info[j].name,pthread->fname,pthread->lineno);
92 _thread_sys_write(fd, s, strlen(s));
93
94 /* Check if this is the running thread: */
95 if (pthread == _thread_run) {
96 /* Output a record for the running thread: */
97 strcpy(s, "This is the running thread\n");
98 _thread_sys_write(fd, s, strlen(s));
99 }
100 /* Check if this is the initial thread: */
101 if (pthread == _thread_initial) {
102 /* Output a record for the initial thread: */
103 strcpy(s, "This is the initial thread\n");
104 _thread_sys_write(fd, s, strlen(s));
105 }
106 /* Process according to thread state: */
107 switch (pthread->state) {
108 /* File descriptor read lock wait: */
109 case PS_FDLR_WAIT:
92 _thread_sys_write(fd, s, strlen(s));
93
94 /* Check if this is the running thread: */
95 if (pthread == _thread_run) {
96 /* Output a record for the running thread: */
97 strcpy(s, "This is the running thread\n");
98 _thread_sys_write(fd, s, strlen(s));
99 }
100 /* Check if this is the initial thread: */
101 if (pthread == _thread_initial) {
102 /* Output a record for the initial thread: */
103 strcpy(s, "This is the initial thread\n");
104 _thread_sys_write(fd, s, strlen(s));
105 }
106 /* Process according to thread state: */
107 switch (pthread->state) {
108 /* File descriptor read lock wait: */
109 case PS_FDLR_WAIT:
110 case PS_FDLW_WAIT:
111 case PS_FDR_WAIT:
112 case PS_FDW_WAIT:
110 /* Write the lock details: */
111 sprintf(s, "fd %d[%s:%d]", pthread->data.fd.fd, pthread->data.fd.fname, pthread->data.fd.branch);
112 _thread_sys_write(fd, s, strlen(s));
113 sprintf(s, "owner %pr/%pw\n", _thread_fd_table[pthread->data.fd.fd]->r_owner, _thread_fd_table[pthread->data.fd.fd]->w_owner);
114 _thread_sys_write(fd, s, strlen(s));
115 break;
116
117 /*

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

135 _thread_sys_write(fd, s, strlen(s));
136
137 /*
138 * Enter a loop to report each thread in the global
139 * dead thread list:
140 */
141 for (pthread = _thread_dead; pthread != NULL; pthread = pthread->nxt) {
142 /* Output a record for the current thread: */
113 /* Write the lock details: */
114 sprintf(s, "fd %d[%s:%d]", pthread->data.fd.fd, pthread->data.fd.fname, pthread->data.fd.branch);
115 _thread_sys_write(fd, s, strlen(s));
116 sprintf(s, "owner %pr/%pw\n", _thread_fd_table[pthread->data.fd.fd]->r_owner, _thread_fd_table[pthread->data.fd.fd]->w_owner);
117 _thread_sys_write(fd, s, strlen(s));
118 break;
119
120 /*

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

138 _thread_sys_write(fd, s, strlen(s));
139
140 /*
141 * Enter a loop to report each thread in the global
142 * dead thread list:
143 */
144 for (pthread = _thread_dead; pthread != NULL; pthread = pthread->nxt) {
145 /* Output a record for the current thread: */
143 sprintf(s, "Thread %p prio %3d\n", pthread, pthread->pthread_priority);
146 sprintf(s, "Thread %p prio %3d [%s:%d]\n", pthread, pthread->pthread_priority,pthread->fname,pthread->lineno);
144 _thread_sys_write(fd, s, strlen(s));
145 }
146 }
147
147 _thread_sys_write(fd, s, strlen(s));
148 }
149 }
150
151 /* Output a header for file descriptors: */
152 strcpy(s, "\n\n=============\nFILE DESCRIPTOR TABLE\n\n");
153 _thread_sys_write(fd, s, strlen(s));
154
148 /* Enter a loop to report file descriptor lock usage: */
149 for (i = 0; i < _thread_dtablesize; i++) {
150 /*
151 * Check if memory is allocated for this file
152 * descriptor:
153 */
154 if (_thread_fd_table[i] != NULL) {
155 /* Report the file descriptor lock status: */

--- 20 unchanged lines hidden ---
155 /* Enter a loop to report file descriptor lock usage: */
156 for (i = 0; i < _thread_dtablesize; i++) {
157 /*
158 * Check if memory is allocated for this file
159 * descriptor:
160 */
161 if (_thread_fd_table[i] != NULL) {
162 /* Report the file descriptor lock status: */

--- 20 unchanged lines hidden ---