changeset 1440:4e50b78c7040

logging
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 24 Jan 2020 08:41:37 -0500
parents 67bed466460e
children 83e2585104b9
files src/luan/modules/ThreadLuan.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/modules/ThreadLuan.java	Fri Jan 24 06:09:50 2020 -0500
+++ b/src/luan/modules/ThreadLuan.java	Fri Jan 24 08:41:37 2020 -0500
@@ -54,10 +54,10 @@
 
 	private static Map<String,Reference<ScheduledFuture>> scheduleds = new ConcurrentHashMap<String,Reference<ScheduledFuture>>();
 
-	private static void cancel(ScheduledFuture sf) {
+	private static void cancel(ScheduledFuture sf,String src) {
 		boolean b = sf.cancel(false);
 		if( !b )
-			logger.error("cancel failed");
+			logger.error(src+" cancel failed isCancelled="+sf.isCancelled()+" isDone="+sf.isDone());
 	}
 
 	public static void schedule(LuanFunction fn,LuanTable options)
@@ -77,7 +77,7 @@
 			if( ref != null ) {
 				ScheduledFuture sf = ref.get();
 				if( sf != null )
-					cancel(sf);
+					cancel(sf,"id");
 			}
 		}
 		Luan luan = fn.luan();
@@ -102,7 +102,7 @@
 		}
 		Object c = new Object() {
 			protected void finalize() throws Throwable {
-				cancel(sf);
+				cancel(sf,"gc");
 			}
 		};
 		luan.registry().put(c,c);  // cancel on gc