File tree 1 file changed +3
-2
lines changed
core/util/src/main/scala/net/liftweb/util
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -72,16 +72,17 @@ sealed trait Schedule extends Loggable {
72
72
73
73
74
74
/** The underlying <code>java.util.concurrent.ScheduledExecutor</code> */
75
- private var service : ScheduledExecutorService = Executors .newSingleThreadScheduledExecutor(TF )
75
+ @ volatile var buildService : () => ScheduledExecutorService = () => Executors .newSingleThreadScheduledExecutor(TF )
76
76
77
+ private var service : ScheduledExecutorService = buildService()
77
78
private var pool = buildExecutor()
78
79
79
80
/**
80
81
* Re-create the underlying <code>SingleThreadScheduledExecutor</code>
81
82
*/
82
83
def restart : Unit = synchronized
83
84
{ if ((service eq null ) || service.isShutdown)
84
- service = Executors .newSingleThreadScheduledExecutor( TF )
85
+ service = buildService()
85
86
if ((pool eq null ) || pool.isShutdown)
86
87
pool = buildExecutor()
87
88
}
You can’t perform that action at this time.
0 commit comments