} catch (RuntimeException e) {
throw e;
} catch (Error e) {
throw e;
} catch (Exception e) {
throw new RuntimeIoException("Failed to create a wakeup socket.", e);
}
boolean success = false;
long newPollset;
try {
newPollset = Poll.create(
POLLSET_SIZE,
pool,
Poll.APR_POLLSET_THREADSAFE,
Long.MAX_VALUE);
if (newPollset == 0) {
newPollset = Poll.create(
62,
pool,
Poll.APR_POLLSET_THREADSAFE,
Long.MAX_VALUE);
}
pollset = newPollset;
if (pollset < 0) {
if (Status.APR_STATUS_IS_ENOTIMPL(- (int) pollset)) {
throw new RuntimeIoException(
"Thread-safe pollset is not supported in this platform.");
}
}
success = true;
} catch (RuntimeException e) {
throw e;
} catch (Error e) {
throw e;
} catch (Exception e) {
throw new RuntimeIoException("Failed to create a pollset.", e);
} finally {
if (!success) {
dispose();
}
}