if (cfs_waitq_active(&the_lnet.ln_waitq))
cfs_waitq_broadcast(&the_lnet.ln_waitq);
#else
-# if !HAVE_LIBPTHREAD
+# ifndef HAVE_LIBPTHREAD
/* LNetEQPoll() calls into _the_ LND to wait for action */
# else
/* Wake anyone waiting in LNetEQPoll() */
#else
if (the_lnet.ln_finalizing)
goto out;
+
+ the_lnet.ln_finalizing = 1;
#endif
while (!list_empty(&the_lnet.ln_finalizeq)) {