예제 #1
0
 /** Remove a bdsThread */
 public synchronized void remove() {
   long id = Thread.currentThread().getId();
   BdsThread bdsThread = get();
   if (bdsThreadByThreadId.get(id) == bdsThread) {
     bdsThreadByThreadId.remove(id);
     bdsThreadDone.add(bdsThread);
   } else throw new RuntimeException("Cannot remove thread '" + bdsThread.getBdsThreadId() + "'");
 }
예제 #2
0
 /**
  * Get canonical path to file using thread's 'current dir' to de-reference relative paths
  *
  * <p>Warning: When un-serializing a task form a checkpoint, threads are not initialized, thus
  * they are null
  */
 public static Data data(String url) {
   BdsThread bdsThread = BdsThreads.getInstance().get();
   if (bdsThread == null) return Data.factory(url);
   return bdsThread.data(url);
 }