shim_object.c 536 B

123456789101112131415161718
  1. #include <pal.h>
  2. #include <shim_internal.h>
  3. int object_wait_with_retry(PAL_HANDLE handle)
  4. {
  5. PAL_HANDLE ret;
  6. do {
  7. ret = DkObjectsWaitAny(1, &handle, NO_TIMEOUT);
  8. } while (ret == NULL && (PAL_NATIVE_ERRNO == PAL_ERROR_INTERRUPTED ||
  9. PAL_NATIVE_ERRNO == PAL_ERROR_TRYAGAIN));
  10. if (ret == NULL) {
  11. debug("waiting on %p resulted in error %s",
  12. handle, PAL_STRERROR(PAL_NATIVE_ERRNO));
  13. return -PAL_NATIVE_ERRNO;
  14. }
  15. assert(ret == handle);
  16. return 0;
  17. }