rx: Set listener pthread name
[openafs.git] / src / rx / rx_pthread.c
index 9dcb9f7..388bca8 100644 (file)
@@ -182,7 +182,7 @@ event_handler(void *argp)
 #endif
        rx_pthread_event_rescheduled = 0;
     }
-    return NULL;
+    AFS_UNREACHED(return(NULL));
 }
 
 
@@ -208,6 +208,12 @@ rxi_ListenerProc(osi_socket sock, int *tnop, struct rx_call **newcallp)
     u_short port;
     struct rx_packet *p = (struct rx_packet *)0;
 
+    if (!(rx_enable_hot_thread && newcallp)) {
+       /* Don't do this for hot threads, since we might stop being the
+        * listener. */
+       opr_threadname_set("rx_Listener");
+    }
+
     MUTEX_ENTER(&listener_mutex);
     while (!listeners_started) {
        CV_WAIT(&rx_listener_cond, &listener_mutex);
@@ -264,8 +270,7 @@ rx_ListenerProc(void *argp)
        rxi_ServerProc(threadID, newcall, &sock);
        /* osi_Assert(sock != OSI_NULLSOCKET); */
     }
-    /* not reached */
-    return NULL;
+    AFS_UNREACHED(return(NULL));
 }
 
 /* This is the server process request loop. The server process loop
@@ -312,8 +317,7 @@ rx_ServerProc(void * dummy)
        /* osi_Assert(threadID != -1); */
        /* osi_Assert(newcall != NULL); */
     }
-    /* not reached */
-    return NULL;
+    AFS_UNREACHED(return(NULL));
 }
 
 /*
@@ -418,9 +422,8 @@ rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
     if (ret < 0) {
        while (rxi_HandleSocketError(socket) > 0)
            ;
+       return ret;
     }
-    return ret;
-
 #else
 # ifdef AFS_LINUX22_ENV
     /* linux unfortunately returns ECONNREFUSED if the target port
@@ -441,8 +444,8 @@ rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
 # endif
        return -1;
     }
-    return 0;
 #endif /* !AFS_RXERRQ_ENV */
+    return 0;
 }
 
 struct rx_ts_info_t * rx_ts_info_init(void) {
@@ -450,7 +453,7 @@ struct rx_ts_info_t * rx_ts_info_init(void) {
     rx_ts_info = calloc(1, sizeof(rx_ts_info_t));
     osi_Assert(rx_ts_info != NULL && pthread_setspecific(rx_ts_info_key, rx_ts_info) == 0);
 #ifdef RX_ENABLE_TSFPQ
-    queue_Init(&rx_ts_info->_FPQ);
+    opr_queue_Init(&rx_ts_info->_FPQ.queue);
 
     MUTEX_ENTER(&rx_packets_mutex);
     rx_TSFPQMaxProcs++;