Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0649e51f5bed
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5167a491a573
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on May 24, 2015

  1. Copy the full SHA
    b9983dd View commit details
  2. Copy the full SHA
    07b138b View commit details
  3. Copy the full SHA
    5167a49 View commit details
Original file line number Diff line number Diff line change
@@ -495,7 +495,7 @@ public Object select(VirtualFrame frame, RubyArray readables, RubyBasicObject wr
readableSet.set(fd);
}

final int ready = getContext().getThreadManager().runOnce(new ThreadManager.BlockingActionWithoutGlobalLock<Integer>() {
final int result = getContext().getThreadManager().runOnce(new ThreadManager.BlockingActionWithoutGlobalLock<Integer>() {
@Override
public Integer block() throws InterruptedException {
return nativeSockets().select(
@@ -507,6 +507,10 @@ public Integer block() throws InterruptedException {
}
});

if (result == -1) {
return nil();
}

return RubyArray.fromObjects(getContext().getCoreLibrary().getArrayClass(),
getSetObjects(readableObjects, readableFds, readableSet),
RubyArray.fromObjects(getContext().getCoreLibrary().getArrayClass()),
Original file line number Diff line number Diff line change
@@ -14,12 +14,12 @@

public class DarwinFDSet implements FDSet {

private final int INT32_SIZE = 4;
private static final int INT32_SIZE = 4;

private final int DARWIN_FD_SETSIZE = 1024;
private final int DARWIN_NBBY = 8;
private final int DARWIN_NFDBITS = INT32_SIZE * DARWIN_NBBY;
private final int FD_BITS_SIZE = __DARWIN_howmany(DARWIN_FD_SETSIZE, DARWIN_NFDBITS);
private static final int DARWIN_FD_SETSIZE = 1024;
private static final int DARWIN_NBBY = 8;
private static final int DARWIN_NFDBITS = INT32_SIZE * DARWIN_NBBY;
private static final int FD_BITS_SIZE = __DARWIN_howmany(DARWIN_FD_SETSIZE, DARWIN_NFDBITS);

private static final MemoryManager memoryManager = jnr.ffi.Runtime.getSystemRuntime().getMemoryManager();

Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ public Pointer getPointer() {

private void checkBounds(int fd) {
if (fd < 0 || fd >= MAX_FDS) {
throw new IllegalArgumentException(String.format("Supplied file descriptor value must be > 0 and < %i", MAX_FDS));
throw new IllegalArgumentException(String.format("Supplied file descriptor value must be > 0 and < %d", MAX_FDS));
}
}