diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-15 17:01:19 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-15 17:01:19 -0800 |
commit | c42b937808924f6b922b29d2e0fd1fe1d1b0411c (patch) | |
tree | 4027d435b6638a7e72b9519990298fb9314ecc96 /tests/doublestart.c | |
parent | 8478d6aee54d6c52de16d8c58309534afbf5bf9e (diff) | |
parent | e5ccf17e84e7a5102bf9e05ffef01e6672b4c15a (diff) |
Merge branch 'incoming'
Diffstat (limited to 'tests/doublestart.c')
-rw-r--r-- | tests/doublestart.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/doublestart.c b/tests/doublestart.c new file mode 100644 index 00000000..533e6308 --- /dev/null +++ b/tests/doublestart.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <emscripten.h> + +int times = 0; + +void later(void* nada) { + int result = times; + REPORT_RESULT(); +} + +void main_loop(void) { + static int cnt = 0; + if (++cnt >= 10) emscripten_cancel_main_loop(); +} + +int main(void) { + emscripten_async_call(later, NULL, 2000); + times++; + printf("This should only appear once.\n"); + emscripten_set_main_loop(main_loop, 10, 0); + return 0; +} + |