pebblisp/src/threads.h

26 lines
542 B
C
Raw Normal View History

#ifdef STANDALONE
#ifndef THREADS_H
#define THREADS_H
#include "pebblisp.h"
Object clonePromise(Object src);
void cleanPromise(struct Promise* promise);
int isDone(struct Promise* promise);
fn(async, "async",
"Run the given lambda on a separate thread.",
"(def sleepy (fn () ((sys \"sleep 0.1\") \"Hiya\"))) (def x (async sleepy)) x", "<PENDING>",
"(def sleepy (fn () ((sys \"sleep 0.1\") \"Hiya\"))) (def x (async sleepy)) (await x)", "Hiya",
);
fn(await, "await",
""
);
#endif // PEBBLISP_THREADS_H
#endif // STANDALONE