Commit 53ffcb26 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e7574978
......@@ -86,6 +86,7 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf)
def storeblk(self, blk, buf): return self.zself.storeblk(blk, buf)
# blkmmapper is pycapsule with virtmem mmap functions for _ZBigFile.
# The functions rely on .wfileh being initialized by .fileh_open()
blkmmapper = PyCapsule_New(<void*>&ZBigFile_mmap_ops, "wendelin.bigfile.IBlkMMapper", NULL)
......@@ -119,7 +120,7 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
# XXX move -> .py ?
cdef wcfs.PyConn pywconnOf(zconn):
assert isinstance(zconn, ZConnection)
assert zconn.opened # XXX needed
assert zconn.opened # XXX needed?
# XXX locking
wconn = getattr(zconn, '_wcfs_wconn', None)
......@@ -149,7 +150,7 @@ class ZSync:
# .wconn
def __init__(zsync, zconn, wconn):
print('ZSync %r %r' % (zconn, wconn))
#print('ZSync %r %r' % (zconn, wconn))
assert zconn.open
zsync.zconn = zconn # XXX -> weakref
zsync.wconn = wconn
......@@ -161,11 +162,11 @@ class ZSync:
# tm.commit() # zconn.at updated again
zconn.onResyncCallback(zsync)
# TODO zconn dealloc -> wconn.close
# DB resyncs .zconn onto new database view.
# -> resync .wconn to updated database view of ZODB connection.
def on_connection_resync(zsync):
#print('\nZZZSync.resync %r %r' % (zsync.zconn, zsync.wconn))
#import traceback; traceback.print_stack()
zsync.wconn.resync(zconn_at(zsync.zconn))
# TODO zconn dealloc -> wconn.close
......@@ -2,7 +2,7 @@
#define _WENDELIN_COMPAT_PY2_H
/* Wendelin. Python2 compatibility
* Copyright (C) 2014-2019 Nexedi SA and Contributors.
* Copyright (C) 2014-2020 Nexedi SA and Contributors.
* Kirill Smelkov <kirr@nexedi.com>
*
* This program is free software: you can Use, Study, Modify and Redistribute
......@@ -102,6 +102,15 @@ static inline PyThreadState * _PyThreadState_UncheckedGet(void)
# error "You are using CPython 3.5.X series. Upgrade your CPython to >= 3.5.2 to get _PyThreadState_UncheckedGet() support."
#endif
/* determine if current thread holds the GIL
* https://stackoverflow.com/a/25666624/9456786 */
#if PY_MAJOR_VERSION < 3
static inline int PyGILState_Check(void)
{
// XXX do we really need it?
abort();
}
#endif
#ifdef __cplusplus
}
......
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