aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Fijalkowski <fijall@gmail.com>2014-02-26 16:29:08 +0200
committerMaciej Fijalkowski <fijall@gmail.com>2014-02-26 16:29:08 +0200
commit768a8f8e7164b577365d714dca24b0d3f78d34cc (patch)
treee18c45f2de4688f57d260155c4fde35f49eec130 /include
parentanother test for [non-None-ptr] * n being virtual, although only if n < 15 (diff)
downloadpypy-768a8f8e7164b577365d714dca24b0d3f78d34cc.tar.gz
pypy-768a8f8e7164b577365d714dca24b0d3f78d34cc.tar.bz2
pypy-768a8f8e7164b577365d714dca24b0d3f78d34cc.zip
improve the embedding interface a little
Diffstat (limited to 'include')
-rw-r--r--include/PyPy.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/PyPy.h b/include/PyPy.h
index 7b77abb10f..b94fc890df 100644
--- a/include/PyPy.h
+++ b/include/PyPy.h
@@ -8,9 +8,14 @@
extern "C" {
#endif
-
/* You should call this first once. */
+#define pypy_init(need_threads) do { pypy_asm_stack_bottom(); \
+rpython_startup_code();\
+ if (need_threads) pypy_init_threads(); } while (0)
+
+// deprecated interface
void rpython_startup_code(void);
+void pypy_init_threads(void);
/* Initialize the home directory of PyPy. It is necessary to call this.
@@ -26,11 +31,10 @@ int pypy_setup_home(char *home, int verbose);
/* If your program has multiple threads, then you need to call
- pypy_init_threads() once at init time, and then pypy_thread_attach()
- once in each other thread that just started and in which you want to
- run Python code (including via callbacks, see below).
+ pypy_thread_attach() once in each other thread that just started
+ and in which you want to run Python code (including via callbacks,
+ see below). DO NOT CALL IT IN THE MAIN THREAD
*/
-void pypy_init_threads(void);
void pypy_thread_attach(void);