1. First a trivial issue! For implementing OpenKode for Win32, if <windows.h> is included before "kd.h" then a compiler error occurs. This because "s_addr" of KDInAddr is typedefed in Windows.h.
Although, the issue is trivial because it is eliminated by changing the order of include files (kd.h first and then windows.h), nevertheless s_addr might be renamed.
2. I'm confused about the specs of kdOnceThread API. If the API is not supposed to fail, how can it create a unique mutex (or any synch obj for that matter) for the KDThreadOnce object? The application also cannot define such mutex at start-up (as suggested in Rationale), because there's no way to associate it with KDThreadOnce object, as it has to be zero initialized.
There is an option that each thread maintains a mutex for this API, but that seems awkward.