ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.c
(Generate patch)

Comparing libeio/eio.c (file contents):
Revision 1.110 by root, Tue Sep 27 12:36:19 2011 UTC vs.
Revision 1.111 by root, Fri Sep 30 20:49:25 2011 UTC

2133 req->result = -1; \ 2133 req->result = -1; \
2134 break; \ 2134 break; \
2135 } \ 2135 } \
2136 } 2136 }
2137 2137
2138static void ecb_noinline ecb_cold
2139etp_proc_init (void)
2140{
2141#if HAVE_PRCTL_SET_NAME
2142 /* provide a more sensible "thread name" */
2143 char name[16 + 1];
2144 const int namelen = sizeof (name) - 1;
2145 int len;
2146
2147 prctl (PR_GET_NAME, (unsigned long)name, 0, 0, 0);
2148 name [namelen] = 0;
2149 len = strlen (name);
2150 strcpy (name + (len < namelen - 4 ? len : namelen - 4), "/eio");
2151 prctl (PR_SET_NAME, (unsigned long)name, 0, 0, 0);
2152}
2153#endif
2154
2138X_THREAD_PROC (etp_proc) 2155X_THREAD_PROC (etp_proc)
2139{ 2156{
2140 ETP_REQ *req; 2157 ETP_REQ *req;
2141 struct timespec ts; 2158 struct timespec ts;
2142 etp_worker *self = (etp_worker *)thr_arg; 2159 etp_worker *self = (etp_worker *)thr_arg;
2143 2160
2144#if HAVE_PRCTL_SET_NAME 2161 etp_proc_init ();
2145 prctl (PR_SET_NAME, (unsigned long)"eio_thread", 0, 0, 0);
2146#endif
2147 2162
2148 /* try to distribute timeouts somewhat evenly */ 2163 /* try to distribute timeouts somewhat evenly */
2149 ts.tv_nsec = ((unsigned long)self & 1023UL) * (1000000000UL / 1024UL); 2164 ts.tv_nsec = ((unsigned long)self & 1023UL) * (1000000000UL / 1024UL);
2150 2165
2151 for (;;) 2166 for (;;)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines