shim_object.c 506 B

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