mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-06-18 21:52:06 +00:00
Add critical sections to Packer buffer protocol methods
This commit is contained in:
parent
e9e211f8e1
commit
ce5088af74
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