Commit 1a0a71d1 authored by gsamain's avatar gsamain Committed by Xavier Thompson

Non-blocking lock macros injection in builtins

parent 6859127e
...@@ -427,6 +427,9 @@ def inject_cypclass_lock_macros(): ...@@ -427,6 +427,9 @@ def inject_cypclass_lock_macros():
blocking_macro_type = PyrexTypes.CFuncType(PyrexTypes.c_void_type, [PyrexTypes.CFuncTypeArg("obj", PyrexTypes.cy_object_type, None)], nogil = 1) blocking_macro_type = PyrexTypes.CFuncType(PyrexTypes.c_void_type, [PyrexTypes.CFuncTypeArg("obj", PyrexTypes.cy_object_type, None)], nogil = 1)
for macro in ("Cy_RLOCK", "Cy_WLOCK", "Cy_UNLOCK"): for macro in ("Cy_RLOCK", "Cy_WLOCK", "Cy_UNLOCK"):
builtin_scope.declare_builtin_cfunction(macro, blocking_macro_type, macro) builtin_scope.declare_builtin_cfunction(macro, blocking_macro_type, macro)
nonblocking_macro_type = PyrexTypes.CFuncType(PyrexTypes.c_int_type, [PyrexTypes.CFuncTypeArg("obj", PyrexTypes.cy_object_type, None)], nogil = 1)
for macro in ("Cy_TRYRLOCK", "Cy_TRYWLOCK"):
builtin_scope.declare_builtin_cfunction(macro, nonblocking_macro_type, macro)
def init_builtins(): def init_builtins():
init_builtin_structs() init_builtin_structs()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment