#define PTHREAD_MUTEX_LOCK if (have_children) pthread_mutex_lock
#define PTHREAD_MUTEX_UNLOCK if (have_children) pthread_mutex_unlock
-static pthread_t NO_SUCH_CHILD_PID;
+#define NO_CHILD_THREAD (0)
#else
/*
* This is easier than ifdef's throughout the code.
*/
if ((request->child_state == REQUEST_QUEUED) ||
((request->child_state == REQUEST_RUNNING) &&
- (pthread_equal(request->child_pid, NO_SUCH_CHILD_PID) == 0))) {
+ (request->thread_id == NO_CHILD_THREAD))) {
/*
* Cap delay at max_request_time
* the request.
*/
if (have_children &&
- (pthread_equal(request->child_pid, NO_SUCH_CHILD_PID) == 0)) {
- radlog(L_ERR, "WARNING: Unresponsive child for request %u, in component %s module %s",
- request->number,
+ (request->thread_id == NO_CHILD_THREAD)) {
+ radlog(L_ERR, "WARNING: Unresponsive thread %d for request %u, in component %s module %s",
+ request->number, request->thread_id,
request->component ? request->component : "<server core>",
request->module ? request->module : "<server core>");
case REQUEST_DONE:
done:
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
#ifdef WITH_COA
case REQUEST_REJECT_DELAY:
case REQUEST_CLEANUP_DELAY:
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
request_stats_final(request);
/* FALL-THROUGH */
DEBUG_PACKET(request, request->proxy, 1);
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
request->proxy_listener->send(request->proxy_listener,
/* FIXME: debug print stuff */
request->child_state = REQUEST_DONE;
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
return 0;
}
request->reply->offset = -2; /* bad authenticator */
request->child_state = REQUEST_DONE;
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
return 0;
}
request->num_proxied_requests = 1;
request->num_proxied_responses = 0;
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
request->child_state = REQUEST_PROXIED;
if (request->packet->dst_port == 0) {
/* FIXME: RDEBUG going to the next request */
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
request->child_state = REQUEST_DONE;
return;
request->next_when = when;
request->next_callback = reject_delay;
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
request->child_state = REQUEST_REJECT_DELAY;
return;
if (have_children) {
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
} else {
/*
request->number = request_num_counter++;
request->priority = listener->type;
#ifdef HAVE_PTHREAD_H
- request->child_pid = NO_SUCH_CHILD_PID;
+ request->thread_id = NO_CHILD_THREAD;
#endif
/*
#endif
#ifdef HAVE_PTHREAD_H
-#ifndef __MINGW32__
- NO_SUCH_CHILD_PID = (pthread_t ) (0);
-#else
- NO_SUCH_CHILD_PID = pthread_self(); /* not a child thread */
-#endif
/*
* Initialize the threads ONLY if we're spawning, AND
* we're running normally.