Changeset 12634
- Timestamp:
- 04/24/10 22:31:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/LispThread.java
r12587 r12634 49 49 new ConcurrentHashMap<Thread,LispThread>(); 50 50 51 LispObject threadValue = NIL; 52 51 53 private static ThreadLocal<LispThread> threads = new ThreadLocal<LispThread>(){ 52 54 @Override … … 88 90 { 89 91 try { 90 funcall(wrapper,92 threadValue = funcall(wrapper, 91 93 new LispObject[] { fun }, 92 94 LispThread.this); … … 931 933 }; 932 934 935 private static final Primitive THREAD_JOIN = 936 new Primitive("thread-join", PACKAGE_THREADS, true, "thread", 937 "Waits for thread to finish.") 938 { 939 @Override 940 public LispObject execute(LispObject arg) 941 { 942 // join the thread, and returns it's value. The second return 943 // value is T if the thread finishes normally, NIL if its 944 // interrupted. 945 if (arg instanceof LispThread) { 946 final LispThread joinedThread = (LispThread) arg; 947 final LispThread waitingThread = currentThread(); 948 try { 949 joinedThread.javaThread.join(); 950 return 951 waitingThread.setValues(joinedThread.threadValue, T); 952 } catch (InterruptedException e) { 953 waitingThread.processThreadInterrupts(); 954 return 955 waitingThread.setValues(joinedThread.threadValue, NIL); 956 } 957 } else { 958 return type_error(arg, Symbol.THREAD); 959 } 960 } 961 }; 962 963 933 964 public static final long javaSleepInterval(LispObject lispSleep) 934 965
Note: See TracChangeset
for help on using the changeset viewer.