Oh, I see now what you mean.
So, the WildFly server is our Jakarta Servlet certified implementation. Undertow contains the pieces used by WildFly, but in order to have the spec fully followed you will need to invoke the GracefulShutdownHandler.
Also, it is interesting to point out that, in the other thread, I said it doesn't make difference which one you do first: Undertow.stop and undeploy. But, in reality, it does. Only when invoking Undertow.stop() you will have the threads fully stopped. When stopping the server in a spec compliant way, probably the order you are looking at is: 1. stop() the deployment; 2. stop() the server; and 3. undeploy. Notice that Undertow.stop() will block until the threads are shutdown if UndertowOptions.SHUTDOWN_TIMEOUT is undefined, guaranteeing you they are gone when Undertow.stop() returns.