From 1ae2877201cff43b500aa7fcb7b444383b6e8ff6 Mon Sep 17 00:00:00 2001
From: Mick Jordan <mick.jordan@oracle.com>
Date: Fri, 1 Jul 2016 08:08:56 -0700
Subject: [PATCH] update to previous changes

---
 .../src/com/oracle/truffle/r/runtime/ffi/DLL.java           | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java
index 9e58b113b2..c4f62ef285 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java
@@ -15,14 +15,12 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.Deque;
 import java.util.concurrent.ConcurrentLinkedDeque;
-import java.util.concurrent.Semaphore;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import com.oracle.truffle.api.CompilerAsserts;
 import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
 import com.oracle.truffle.r.runtime.RError;
 import com.oracle.truffle.r.runtime.RError.RErrorException;
-import com.oracle.truffle.r.runtime.RInternalError;
 import com.oracle.truffle.r.runtime.RRuntime;
 import com.oracle.truffle.r.runtime.ReturnException;
 import com.oracle.truffle.r.runtime.Utils;
@@ -247,7 +245,7 @@ public class DLL {
         }
     }
 
-    public static DLLInfo getDLLInfoForId(int id) {
+    public static synchronized DLLInfo getDLLInfoForId(int id) {
         for (DLLInfo dllInfo : list) {
             if (dllInfo.id == id) {
                 return dllInfo;
@@ -354,7 +352,7 @@ public class DLL {
         throw new DLLException(RError.Message.DLL_NOT_LOADED, path);
     }
 
-    public static ArrayList<DLLInfo> getLoadedDLLs() {
+    public static synchronized ArrayList<DLLInfo> getLoadedDLLs() {
         ArrayList<DLLInfo> result = new ArrayList<>();
         for (DLLInfo dllInfo : list) {
             result.add(dllInfo);
-- 
GitLab