Executor.execute method added
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package std.concurrent
|
package std.concurrent
|
||||||
|
|
||||||
import java.lang.*
|
import java.lang.*
|
||||||
|
import java.util.concurrent.Executor
|
||||||
|
|
||||||
inline val currentThread = Thread.currentThread().sure()
|
inline val currentThread = Thread.currentThread().sure()
|
||||||
|
|
||||||
@@ -41,3 +42,11 @@ fun thread(start: Boolean = true, daemon: Boolean = false, contextClassLoader: C
|
|||||||
thread.start()
|
thread.start()
|
||||||
return thread
|
return thread
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline fun Executor.execute(action: ()->Unit) {
|
||||||
|
execute(object: Runnable{
|
||||||
|
override fun run() {
|
||||||
|
action()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user