mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-06-18 21:52:06 +00:00
Guard Packer buffer protocol hooks with Cython critical sections (#686)
This commit is contained in:
parent
d627d308ef
commit
7df7136e20
1 changed files with 2 additions and 0 deletions
|
|
@ -360,9 +360,11 @@ cdef class Packer:
|
|||
"""
|
||||
return memoryview(self)
|
||||
|
||||
@cython.critical_section
|
||||
def __getbuffer__(self, Py_buffer *buffer, int flags):
|
||||
PyBuffer_FillInfo(buffer, self, self.pk.buf, self.pk.length, 1, flags)
|
||||
self.exports += 1
|
||||
|
||||
@cython.critical_section
|
||||
def __releasebuffer__(self, Py_buffer *buffer):
|
||||
self.exports -= 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue