@@ -1385,6 +1385,32 @@ void run_active_slot(struct active_request_slot *slot)
1385
1385
select (max_fd + 1 , & readfds , & writefds , & excfds , & select_timeout );
1386
1386
}
1387
1387
}
1388
+
1389
+ /*
1390
+ * The value of slot->finished we set before the loop was used
1391
+ * to set our "finished" variable when our request completed.
1392
+ *
1393
+ * 1. The slot may not have been reused for another requst
1394
+ * yet, in which case it still has &finished.
1395
+ *
1396
+ * 2. The slot may already be in-use to serve another request,
1397
+ * which can further be divided into two cases:
1398
+ *
1399
+ * (a) If call run_active_slot() hasn't been called for that
1400
+ * other request, slot->finished would have been cleared
1401
+ * by get_active_slot() and has NULL.
1402
+ *
1403
+ * (b) If the request did call run_active_slot(), then the
1404
+ * call would have updated slot->finished at the beginning
1405
+ * of this function, and with the clearing of the member
1406
+ * below, we would find that slot->finished is now NULL.
1407
+ *
1408
+ * In all cases, slot->finished has no useful information to
1409
+ * anybody at this point. Some compilers warn us for
1410
+ * attempting to smuggle a pointer that is about to become
1411
+ * invalid, i.e. &finished. We clear it here to assure them.
1412
+ */
1413
+ slot -> finished = NULL ;
1388
1414
}
1389
1415
1390
1416
static void release_active_slot (struct active_request_slot * slot )
0 commit comments