()
| 31 | |
| 32 | new Thread() { |
| 33 | public void run() |
| 34 | { |
| 35 | while(!bHasFinished) |
| 36 | { |
| 37 | if (doCleanup) |
| 38 | { |
| 39 | int refBefore, refAfter; |
| 40 | while(true) |
| 41 | { |
| 42 | refBefore = featureDefn.GetReferenceCount(); |
| 43 | System.out.print("i=" + i + " ref(before)="+ refBefore ); |
| 44 | System.runFinalization(); |
| 45 | refAfter = featureDefn.GetReferenceCount(); |
| 46 | System.out.println(" ref(after)="+ refAfter ); |
| 47 | if (refBefore == refAfter) |
| 48 | System.gc(); |
| 49 | else |
| 50 | break; |
| 51 | } |
| 52 | synchronized (mutex) { |
| 53 | doCleanup = false; |
| 54 | mutex.notify(); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | synchronized (mutex) { |
| 59 | while (doCleanup == false && bHasFinished == false) |
| 60 | { |
| 61 | //System.out.println("thread wakeup"); |
| 62 | try |
| 63 | { |
| 64 | mutex.wait(); |
| 65 | } |
| 66 | catch(InterruptedException ie) |
| 67 | { |
| 68 | System.out.println("InterruptedException"); |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | }.start(); |
| 75 | |
| 76 | // Add features |
nothing calls this directly
no test coverage detected