It appears, on line 371 of lwkt_msgport.c, function lwkt_default_waitport, that there is a call to enter a critical section which might be unnecessary because it already exists within a critical section.