diff options
author | Eduardo Julian | 2019-04-16 18:47:13 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-16 18:47:13 -0400 |
commit | 42248854f0cb5e3364e6aae25527cee65cbda3e8 (patch) | |
tree | c0a8c65fb8dc11d85cca22fe03182f39bf22ef1a /stdlib/source/lux/control/concurrency/process.lux | |
parent | afddac31e065ae1df0c7c78cc2ce6d13b01896c6 (diff) |
The old compiler is now identified with "old" instead of "jvm". This should help to get old JVM code and new JVM code to coexist without forcing a major rewrite of old compiler code to get it to fit the style of the new JVM compiler code.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/control/concurrency/process.lux | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/stdlib/source/lux/control/concurrency/process.lux b/stdlib/source/lux/control/concurrency/process.lux index c7f9ae82e..322300a17 100644 --- a/stdlib/source/lux/control/concurrency/process.lux +++ b/stdlib/source/lux/control/concurrency/process.lux @@ -15,26 +15,26 @@ [// ["." atom (#+ Atom)]]) -(`` (for {(~~ (static host.jvm)) - (as-is (import: java/lang/Object) +(`` (for {(~~ (static host.old)) + (as-is (import: #long java/lang/Object) - (import: java/lang/Runtime - (#static getRuntime [] Runtime) + (import: #long java/lang/Runtime + (#static getRuntime [] java/lang/Runtime) (availableProcessors [] int)) - (import: java/lang/Runnable) + (import: #long java/lang/Runnable) - (import: java/util/concurrent/TimeUnit + (import: #long java/util/concurrent/TimeUnit (#enum MILLISECONDS)) - (import: java/util/concurrent/Executor - (execute [Runnable] #io void)) + (import: #long java/util/concurrent/Executor + (execute [java/lang/Runnable] #io void)) - (import: (java/util/concurrent/ScheduledFuture a)) + (import: #long (java/util/concurrent/ScheduledFuture a)) - (import: java/util/concurrent/ScheduledThreadPoolExecutor + (import: #long java/util/concurrent/ScheduledThreadPoolExecutor (new [int]) - (schedule [Runnable long TimeUnit] #io (ScheduledFuture Object))))} + (schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] #io (java/util/concurrent/ScheduledFuture java/lang/Object))))} ## Default (type: Process @@ -45,17 +45,17 @@ (def: #export parallelism Nat - (`` (for {(~~ (static host.jvm)) - (|> (Runtime::getRuntime) - (Runtime::availableProcessors) + (`` (for {(~~ (static host.old)) + (|> (java/lang/Runtime::getRuntime) + (java/lang/Runtime::availableProcessors) .nat)} ## Default 1))) (def: runner - (`` (for {(~~ (static host.jvm)) - (ScheduledThreadPoolExecutor::new (.int ..parallelism))} + (`` (for {(~~ (static host.old)) + (java/util/concurrent/ScheduledThreadPoolExecutor::new (.int ..parallelism))} ## Default (: (Atom (List Process)) @@ -63,15 +63,15 @@ (def: #export (schedule milli-seconds action) (-> Nat (IO Any) (IO Any)) - (`` (for {(~~ (static host.jvm)) - (let [runnable (object [] [Runnable] + (`` (for {(~~ (static host.old)) + (let [runnable (object [] [java/lang/Runnable] [] - (Runnable [] (run) void - (io.run action)))] + (java/lang/Runnable [] (run) void + (io.run action)))] (case milli-seconds - 0 (Executor::execute runnable runner) - _ (ScheduledThreadPoolExecutor::schedule runnable (.int milli-seconds) TimeUnit::MILLISECONDS - runner)))} + 0 (java/util/concurrent/Executor::execute runnable runner) + _ (java/util/concurrent/ScheduledThreadPoolExecutor::schedule runnable (.int milli-seconds) java/util/concurrent/TimeUnit::MILLISECONDS + runner)))} ## Default (atom.update (|>> (#.Cons {#creation ("lux io current-time") @@ -79,7 +79,7 @@ #action action})) runner)))) -(`` (for {(~~ (static host.jvm)) +(`` (for {(~~ (static host.old)) (as-is)} ## Default |