Merge lp:~thisfred/u1db/fix-nogil-cython-issues into lp:u1db

Proposed by Eric Casteleijn
Status: Merged
Approved by: Eric Casteleijn
Approved revision: 361
Merged at revision: 360
Proposed branch: lp:~thisfred/u1db/fix-nogil-cython-issues
Merge into: lp:u1db
Diff against target: 60 lines (+15/-4)
1 file modified
u1db/tests/c_backend_wrapper.pyx (+15/-4)
To merge this branch: bzr merge lp:~thisfred/u1db/fix-nogil-cython-issues
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+116620@code.launchpad.net

Commit message

Fixed the issues with the new version of Cython in Quantal.

Description of the change

This should fix the issues with the new version of Cython in Quantal. Please confirm.

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

Seems to successfully cythonify the code on quantal with this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'u1db/tests/c_backend_wrapper.pyx'
2--- u1db/tests/c_backend_wrapper.pyx 2012-07-19 19:50:58 +0000
3+++ u1db/tests/c_backend_wrapper.pyx 2012-07-25 11:20:31 +0000
4@@ -710,11 +710,13 @@
5 cdef int st_gen = 0, source_gen = 0, status
6 cdef char *trans_id = NULL
7 cdef char *st_trans_id = NULL
8+ cdef char *c_source_replica_uid = NULL
9
10 self._check()
11 assert self._st.get_sync_info != NULL, "get_sync_info is NULL?"
12+ c_source_replica_uid = source_replica_uid
13 with nogil:
14- status = self._st.get_sync_info(self._st, source_replica_uid,
15+ status = self._st.get_sync_info(self._st, c_source_replica_uid,
16 &st_replica_uid, &st_gen, &st_trans_id, &source_gen, &trans_id)
17 handle_status("get_sync_info", status)
18 res_trans_id = None
19@@ -731,12 +733,19 @@
20
21 def record_sync_info(self, source_replica_uid, source_gen, source_trans_id):
22 cdef int status
23+ cdef int c_source_gen
24+ cdef char *c_source_replica_uid = NULL
25+ cdef char *c_source_trans_id = NULL
26
27 self._check()
28 assert self._st.record_sync_info != NULL, "record_sync_info is NULL?"
29+ c_source_replica_uid = source_replica_uid
30+ c_source_gen = source_gen
31+ c_source_trans_id = source_trans_id
32 with nogil:
33- status = self._st.record_sync_info(self._st, source_replica_uid,
34- source_gen, source_trans_id)
35+ status = self._st.record_sync_info(
36+ self._st, c_source_replica_uid, c_source_gen,
37+ c_source_trans_id)
38 handle_status("record_sync_info", status)
39
40 def _get_sync_exchange(self, source_replica_uid, source_gen):
41@@ -804,6 +813,7 @@
42 cdef int *generations = NULL
43 cdef const_char_ptr *trans_ids = NULL
44 cdef char *target_trans_id = NULL
45+ cdef char *c_source_replica_uid = NULL
46 cdef int i, count, status, target_gen
47
48 self._check()
49@@ -828,9 +838,10 @@
50 target_gen = last_known_generation
51 if last_known_trans_id is not None:
52 target_trans_id = last_known_trans_id
53+ c_source_replica_uid = source_replica_uid
54 with nogil:
55 status = self._st.sync_exchange(
56- self._st, source_replica_uid, count, docs, generations,
57+ self._st, c_source_replica_uid, count, docs, generations,
58 trans_ids, &target_gen, &target_trans_id,
59 <void *>return_doc_cb, return_doc_cb_wrapper)
60 handle_status("sync_exchange", status)

Subscribers

People subscribed via source and target branches