Index: org/openide/loaders/DataObjectPool.java =================================================================== RCS file: /cvs/openide/src/org/openide/loaders/DataObjectPool.java,v retrieving revision 1.71 diff -c -r1.71 DataObjectPool.java *** org/openide/loaders/DataObjectPool.java 18 Dec 2002 23:41:35 -0000 1.71 --- org/openide/loaders/DataObjectPool.java 8 Jan 2003 16:01:03 -0000 *************** *** 745,750 **** --- 745,752 ---- private Thread current; /** number of threads waiting to enter the validation */ private int waiters; + /** Number of calls to enter by current thread minus 1 */ + private int reenterCount; /** set of files that has been marked recognized (FileObject) */ private HashSet recognizedFiles; /** set with all objects that refused to be discarded (DataObject) */ *************** *** 759,775 **** * @return the set of files concatenated with any previous sets */ private synchronized Set enter (Set set) { ! waiters++; ! /** recursive call (current == Thread.currentThread ()) causes deadlock*/ ! while (current != null) { ! try { ! wait (); ! } catch (InterruptedException ex) { } } ! current = Thread.currentThread (); ! waiters--; ! if (files == null) { files = set; } else { --- 761,780 ---- * @return the set of files concatenated with any previous sets */ private synchronized Set enter (Set set) { ! if (current == Thread.currentThread ()) { ! reenterCount++; ! } else { ! waiters++; ! while (current != null) { ! try { ! wait (); ! } catch (InterruptedException ex) { ! } } + current = Thread.currentThread (); + waiters--; } ! if (files == null) { files = set; } else { *************** *** 782,792 **** /** Leaves the critical section. */ private synchronized void exit () { ! current = null; ! if (waiters == 0) { ! files = null; } - notify (); } /** If there is another waiting thread, then I can --- 787,801 ---- /** Leaves the critical section. */ private synchronized void exit () { ! if (reenterCount == 0) { ! current = null; ! if (waiters == 0) { ! files = null; ! } ! notify (); ! } else { ! reenterCount--; } } /** If there is another waiting thread, then I can