Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
info.c
Package: mysql-3.23.35.tar.gz [view]
Upload User: tsgydb
Upload Date: 2007-04-14
Package Size: 10674k
Code Size: 2k
Category:
MySQL
Development Platform:
Visual C++
- /* hello */
- #include <stdio.h>
- #include <pthread.h>
- #include <signal.h>
- static const char *const state_names[] = {
- #define __pthread_defstate(S,NAME) NAME,
- #include "pthread/state.def"
- #undef __pthread_defstate
- 0
- };
- void (*dump_thread_info_fn) (struct pthread *, FILE *);
- static void
- dump_thread_info (thread, file)
- struct pthread *thread;
- FILE *file;
- {
- /* machdep */
- /* attr */
- /* signals */
- /* wakeup_time */
- /* join */
- fprintf (file, " thread @%p prio %3d %s", thread,
- thread->pthread_priority, state_names[(int) thread->state]);
- switch (thread->state) {
- case PS_FDLR_WAIT:
- fprintf (file, " fd %d[%d]", thread->data.fd.fd,
- thread->data.fd.branch);
- fprintf (file, " owner %pr/%pw",
- fd_table[thread->data.fd.fd]->r_owner,
- fd_table[thread->data.fd.fd]->w_owner);
- break;
- }
- /* show where the signal handler gets run */
- if (thread == pthread_run)
- fprintf (file, "tt[ME!]");
- fprintf (file, "n");
- if (dump_thread_info_fn)
- (*dump_thread_info_fn) (thread, file);
- }
- static void
- pthread_dump_info_to_file (file)
- FILE *file;
- {
- pthread_t t;
- for (t = pthread_link_list; t; t = t->pll)
- dump_thread_info (t, file);
- }
- void
- pthread_dump_info ()
- {
- if (ftrylockfile (stderr) != 0)
- return;
- fprintf (stderr, "process id %ld:n", (long) getpid ());
- pthread_dump_info_to_file (stderr);
- funlockfile (stderr);
- }
- #ifdef SIGINFO
- static void
- sig_handler (sig)
- int sig;
- {
- pthread_dump_info ();
- }
- void
- pthread_setup_siginfo ()
- {
- (void) signal (SIGINFO, sig_handler);
- }
- #endif