The flags field is private, you can't test it like that, and it gives a compilation error. You could use uv_is_closing, but that's not exactly what the same.