mirror of
https://github.com/ParkerTenBroeck/coroutines.git
synced 2026-06-07 05:08:51 -04:00
removed debug things
This commit is contained in:
parent
ce4dd70407
commit
386ec9d0d7
2 changed files with 2 additions and 56 deletions
|
|
@ -13,63 +13,10 @@ public class Main implements Runnable {
|
||||||
RT.runWithGeneratorSupport(Main.class);
|
RT.runWithGeneratorSupport(Main.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static class Meow implements AutoCloseable{
|
|
||||||
{System.out.println("CREATED");}
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
System.out.println("CLOSED");
|
|
||||||
}
|
|
||||||
public static AutoCloseable test(){
|
|
||||||
return new Meow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
synchronized Future<Void, RuntimeException> nya(){
|
|
||||||
|
|
||||||
try(@Cancellation("close") var nya = Meow.test()){
|
|
||||||
System.out.println("POLLED");
|
|
||||||
Future.yield();
|
|
||||||
System.out.println("POLLED");
|
|
||||||
Future.yield();
|
|
||||||
int beep = 1;
|
|
||||||
System.out.println("POLLED");
|
|
||||||
Future.yield();
|
|
||||||
System.out.println("POLLED");
|
|
||||||
Future.yield();
|
|
||||||
return Future.ret(null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// new Jokio().blocking();
|
lexer();
|
||||||
var future = nya();
|
await();
|
||||||
future.poll(null);
|
|
||||||
future.poll(null);
|
|
||||||
future.cancel();
|
|
||||||
// new Jokio().blocking(AsyncExamples.meow());
|
|
||||||
// new Jokio().blocking(new AsyncExamples().meow2());
|
|
||||||
// async_lambda(() -> {
|
|
||||||
// System.out.println("START");
|
|
||||||
// Delay.delay(100).await();
|
|
||||||
// System.out.println("END");
|
|
||||||
// return Future.ret();
|
|
||||||
// });
|
|
||||||
// async_lambda(() -> {
|
|
||||||
// var start = System.currentTimeMillis();
|
|
||||||
// while(true){
|
|
||||||
// Util.first(Delay.delay(500), Delay.delay(1000)).await();
|
|
||||||
// var end = System.currentTimeMillis();
|
|
||||||
// System.out.println(end-start);
|
|
||||||
// start = end;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// lexer();
|
|
||||||
// await();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void async_lambda(Supplier<Future<?, ?>> lambda){
|
void async_lambda(Supplier<Future<?, ?>> lambda){
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ public class FrameTracker {
|
||||||
for(var coe : src_com){
|
for(var coe : src_com){
|
||||||
if(coe instanceof Instruction) {
|
if(coe instanceof Instruction) {
|
||||||
frames.add(new Frame(ft.locals(), ft.stack(), ft.bci, ft.current_line_number, ft.local_annotations()));
|
frames.add(new Frame(ft.locals(), ft.stack(), ft.bci, ft.current_line_number, ft.local_annotations()));
|
||||||
System.out.println(frames.getLast());
|
|
||||||
}
|
}
|
||||||
ft.encounter(coe);
|
ft.encounter(coe);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue