Skip to content

Commit

Permalink
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions core/src/main/java/org/jruby/ext/etc/RubyEtc.java
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ private static IRubyObject intoStringArray(Ruby runtime, String[] members) {


@JRubyMethod(optional=1, module = true)
public static IRubyObject getpwuid(IRubyObject recv, IRubyObject[] args) {
public static synchronized IRubyObject getpwuid(IRubyObject recv, IRubyObject[] args) {
Ruby runtime = recv.getRuntime();
POSIX posix = runtime.getPosix();
IRubyObject oldExc = runtime.getGlobalVariables().get("$!"); // Save $!
@@ -143,7 +143,7 @@ public static IRubyObject getpwuid(IRubyObject recv, IRubyObject[] args) {
}

@JRubyMethod(required=1, module = true)
public static IRubyObject getpwnam(IRubyObject recv, IRubyObject name) {
public static synchronized IRubyObject getpwnam(IRubyObject recv, IRubyObject name) {
Ruby runtime = recv.getRuntime();
String nam = name.convertToString().toString();
try {
@@ -166,7 +166,7 @@ public static IRubyObject getpwnam(IRubyObject recv, IRubyObject name) {
}

@JRubyMethod(module = true)
public static IRubyObject passwd(IRubyObject recv, Block block) {
public static synchronized IRubyObject passwd(IRubyObject recv, Block block) {
Ruby runtime = recv.getRuntime();
POSIX posix = runtime.getPosix();
try {
@@ -206,7 +206,7 @@ public static IRubyObject passwd(IRubyObject recv, Block block) {
}

@JRubyMethod(module = true)
public static IRubyObject getlogin(IRubyObject recv) {
public static synchronized IRubyObject getlogin(IRubyObject recv) {
Ruby runtime = recv.getRuntime();

try {
@@ -228,7 +228,7 @@ public static IRubyObject getlogin(IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject endpwent(IRubyObject recv) {
public static synchronized IRubyObject endpwent(IRubyObject recv) {
Ruby runtime = recv.getRuntime();
try {
runtime.getPosix().endpwent();
@@ -241,7 +241,7 @@ public static IRubyObject endpwent(IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject setpwent(IRubyObject recv) {
public static synchronized IRubyObject setpwent(IRubyObject recv) {
Ruby runtime = recv.getRuntime();
try {
runtime.getPosix().setpwent();
@@ -254,7 +254,7 @@ public static IRubyObject setpwent(IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject getpwent(IRubyObject recv) {
public static synchronized IRubyObject getpwent(IRubyObject recv) {
Ruby runtime = recv.getRuntime();
try {
Passwd passwd = runtime.getPosix().getpwent();
@@ -272,7 +272,7 @@ public static IRubyObject getpwent(IRubyObject recv) {
}

@JRubyMethod(required=1, module = true)
public static IRubyObject getgrnam(IRubyObject recv, IRubyObject name) {
public static synchronized IRubyObject getgrnam(IRubyObject recv, IRubyObject name) {
Ruby runtime = recv.getRuntime();
String nam = name.convertToString().toString();
try {
@@ -295,7 +295,7 @@ public static IRubyObject getgrnam(IRubyObject recv, IRubyObject name) {
}

@JRubyMethod(optional=1, module = true)
public static IRubyObject getgrgid(IRubyObject recv, IRubyObject[] args) {
public static synchronized IRubyObject getgrgid(IRubyObject recv, IRubyObject[] args) {
Ruby runtime = recv.getRuntime();
POSIX posix = runtime.getPosix();

@@ -320,7 +320,7 @@ public static IRubyObject getgrgid(IRubyObject recv, IRubyObject[] args) {
}

@JRubyMethod(module = true)
public static IRubyObject endgrent(IRubyObject recv) {
public static synchronized IRubyObject endgrent(IRubyObject recv) {
Ruby runtime = recv.getRuntime();
try {
runtime.getPosix().endgrent();
@@ -333,7 +333,7 @@ public static IRubyObject endgrent(IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject setgrent(IRubyObject recv) {
public static synchronized IRubyObject setgrent(IRubyObject recv) {
Ruby runtime = recv.getRuntime();
try {
runtime.getPosix().setgrent();
@@ -346,7 +346,7 @@ public static IRubyObject setgrent(IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject group(IRubyObject recv, Block block) {
public static synchronized IRubyObject group(IRubyObject recv, Block block) {
Ruby runtime = recv.getRuntime();
POSIX posix = runtime.getPosix();

@@ -391,7 +391,7 @@ public static IRubyObject group(IRubyObject recv, Block block) {
}

@JRubyMethod(module = true)
public static IRubyObject getgrent(IRubyObject recv) {
public static synchronized IRubyObject getgrent(IRubyObject recv) {
Ruby runtime = recv.getRuntime();
try {
Group gr;
@@ -416,7 +416,7 @@ public static IRubyObject getgrent(IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject systmpdir(ThreadContext context, IRubyObject recv) {
public static synchronized IRubyObject systmpdir(ThreadContext context, IRubyObject recv) {
Ruby runtime = context.getRuntime();
ByteList tmp = ByteList.create(System.getProperty("java.io.tmpdir")); // default for all platforms except Windows
if (Platform.IS_WINDOWS) {
@@ -430,7 +430,7 @@ public static IRubyObject systmpdir(ThreadContext context, IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject sysconfdir(ThreadContext context, IRubyObject recv) {
public static synchronized IRubyObject sysconfdir(ThreadContext context, IRubyObject recv) {
Ruby runtime = context.getRuntime();
ByteList tmp = ByteList.create(RbConfigLibrary.getSysConfDir(runtime)); // default for all platforms except Windows

@@ -446,13 +446,13 @@ public static IRubyObject sysconfdir(ThreadContext context, IRubyObject recv) {
}

@JRubyMethod(module = true)
public static IRubyObject nprocessors(ThreadContext context, IRubyObject recv) {
public static synchronized IRubyObject nprocessors(ThreadContext context, IRubyObject recv) {
int nprocs = Runtime.getRuntime().availableProcessors();
return RubyFixnum.newFixnum(context.getRuntime(), nprocs);
}

@JRubyMethod(module = true)
public static IRubyObject uname(ThreadContext context, IRubyObject self) {
public static synchronized IRubyObject uname(ThreadContext context, IRubyObject self) {
Ruby runtime = context.runtime;
RubyHash uname = RubyHash.newHash(runtime);

0 comments on commit f7746d0

Please sign in to comment.