aboutsummaryrefslogtreecommitdiff
path: root/tests/worker_api_worker.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-22 15:30:03 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-22 15:30:03 -0700
commite48db465e2a2f13b2e9c4797d3334fc6d2b29b6d (patch)
tree79937100322df639de1bc78b3f1d3dd25871650c /tests/worker_api_worker.cpp
parent11a4926fc6c2bfe43fef3c66ad30e4b2df612616 (diff)
initial work on worker api
Diffstat (limited to 'tests/worker_api_worker.cpp')
-rw-r--r--tests/worker_api_worker.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/worker_api_worker.cpp b/tests/worker_api_worker.cpp
new file mode 100644
index 00000000..9a671a91
--- /dev/null
+++ b/tests/worker_api_worker.cpp
@@ -0,0 +1,16 @@
+#include <assert.h>
+#include <emscripten.h>
+
+extern "C" {
+
+void one(char *data, int size) {
+ int *x = (int*)data;
+ int num = size/sizeof(int);
+ for (int i = 0; i < num; i++) {
+ x[i] += 1234;
+ }
+ emscripten_worker_respond(data, size);
+}
+
+}
+