zmq.util.Errno Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jeromq Show documentation
Show all versions of jeromq Show documentation
Pure Java implementation of libzmq
package zmq.util;
// Emulates the errno mechanism present in C++, in a per-thread basis.
public final class Errno
{
private static final ThreadLocal local = new ThreadLocal()
{
@Override
protected Integer initialValue()
{
return 0; // by default
}
};
public int get()
{
return local.get();
}
public void set(int errno)
{
local.set(errno);
}
public boolean is(int err)
{
return get() == err;
}
@Override
public String toString()
{
return "Errno[" + get() + "]";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy