I am not sure here, and I learned that playing around with UnsafePointers in Playgrounds is a good way to lose all of your sandbox code.
If you change
pWaitSemaphores = UnsafePointer(waitSemaphores)
to
pWaitSemaphores = Optional<UnsafePointer>(waitSemaphores)
does that do what you want?