Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
53ffcb26
Commit
53ffcb26
authored
Apr 01, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e7574978
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
bigfile/_file_zodb.pyx
bigfile/_file_zodb.pyx
+5
-4
include/wendelin/compat_py2.h
include/wendelin/compat_py2.h
+10
-1
No files found.
bigfile/_file_zodb.pyx
View file @
53ffcb26
...
...
@@ -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
include/wendelin/compat_py2.h
View file @
53ffcb26
...
...
@@ -2,7 +2,7 @@
#define _WENDELIN_COMPAT_PY2_H
/* Wendelin. Python2 compatibility
* Copyright (C) 2014-20
19
Nexedi SA and Contributors.
* Copyright (C) 2014-20
20
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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment