summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-12-01 20:49:53 +0100
committerArmin Rigo <arigo@tunes.org>2015-12-01 20:49:53 +0100
commit6869ffb621df4500f91264b8a479edccc9e26b96 (patch)
treef5970c93868a08a2e9836bee547d64b4913f1b18 /demo
parentb34bd59f54841aa763f84c9f6510fc3d7199b457 (diff)
downloadcffi-6869ffb621df4500f91264b8a479edccc9e26b96.tar.gz
Carefully craft the setup logic to handle multiple threads and
reentrancy. This should ideally be tested (as usual multithreading is a mess to test, but still).
Diffstat (limited to 'demo')
-rw-r--r--demo/embedding.py2
-rw-r--r--demo/embedding_test.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/demo/embedding.py b/demo/embedding.py
index 08e0a7c..0d776ef 100644
--- a/demo/embedding.py
+++ b/demo/embedding.py
@@ -9,6 +9,8 @@ ffi.cdef("""
ffi.embedding_init_code("""
from _embedding_cffi import ffi, lib
+ print "preparing"
+
@ffi.def_extern()
def add(x, y):
print "adding", x, "and", y
diff --git a/demo/embedding_test.c b/demo/embedding_test.c
index 9f9a874..72c72d8 100644
--- a/demo/embedding_test.c
+++ b/demo/embedding_test.c
@@ -13,5 +13,7 @@ int main(void)
{
int res = add(40, 2);
printf("result: %d\n", res);
+ res = add(100, -5);
+ printf("result: %d\n", res);
return 0;
}