Nick Coghlan <ncogh...@gmail.com> added the comment:

Rather than exposing the function pointers directly to the linker, I'd be 
happier with a function based API, with the pointer storage then being made 
static inside ceval.c.

/* Each function returns the old func, or NULL on failure */
_PyEval_GIL_func _PyEval_replace_take_GIL(_PyEval_GIL_func take_gil); 
_PyEval_GIL_func _PyEval_replace_drop_GIL(_PyEval_GIL_func drop_gil); 


The redirection code (sans error checking) would then look like:

old_take_gil = _PyEval_replace_take_GIL(stm_take_gil);
old_drop_gil = _PyEval_replace_drop_GIL(stm_drop_gil);

Currently they'd just replace the statics and would never fail, but it provides 
looser coupling regardless.

----------
nosy: +ncoghlan

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12850>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to