Creates a new cleaner. @param ob the referent object to be cleaned @param thunk The cleanup code to be run when the cleaner is invoked. The cleanup code is run directly from the reference-handler thread, so it should be as simple and straightforward as possible. @return
(Object ob, Runnable thunk)
| 128 | * @return The new cleaner |
| 129 | */ |
| 130 | public static Cleaner create(Object ob, Runnable thunk) { |
| 131 | if (thunk == null) |
| 132 | return null; |
| 133 | return add(new Cleaner(ob, thunk)); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Runs this cleaner, if it has not been run before. |
no test coverage detected