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
=== modified file 'u1db/tests/c_backend_wrapper.pyx'
--- u1db/tests/c_backend_wrapper.pyx 2012-07-19 19:50:58 +0000
+++ u1db/tests/c_backend_wrapper.pyx 2012-07-25 11:20:31 +0000
@@ -710,11 +710,13 @@
710 cdef int st_gen = 0, source_gen = 0, status710 cdef int st_gen = 0, source_gen = 0, status
711 cdef char *trans_id = NULL711 cdef char *trans_id = NULL
712 cdef char *st_trans_id = NULL712 cdef char *st_trans_id = NULL
713 cdef char *c_source_replica_uid = NULL
713714
714 self._check()715 self._check()
715 assert self._st.get_sync_info != NULL, "get_sync_info is NULL?"716 assert self._st.get_sync_info != NULL, "get_sync_info is NULL?"
717 c_source_replica_uid = source_replica_uid
716 with nogil:718 with nogil:
717 status = self._st.get_sync_info(self._st, source_replica_uid,719 status = self._st.get_sync_info(self._st, c_source_replica_uid,
718 &st_replica_uid, &st_gen, &st_trans_id, &source_gen, &trans_id)720 &st_replica_uid, &st_gen, &st_trans_id, &source_gen, &trans_id)
719 handle_status("get_sync_info", status)721 handle_status("get_sync_info", status)
720 res_trans_id = None722 res_trans_id = None
@@ -731,12 +733,19 @@
731733
732 def record_sync_info(self, source_replica_uid, source_gen, source_trans_id):734 def record_sync_info(self, source_replica_uid, source_gen, source_trans_id):
733 cdef int status735 cdef int status
736 cdef int c_source_gen
737 cdef char *c_source_replica_uid = NULL
738 cdef char *c_source_trans_id = NULL
734739
735 self._check()740 self._check()
736 assert self._st.record_sync_info != NULL, "record_sync_info is NULL?"741 assert self._st.record_sync_info != NULL, "record_sync_info is NULL?"
742 c_source_replica_uid = source_replica_uid
743 c_source_gen = source_gen
744 c_source_trans_id = source_trans_id
737 with nogil:745 with nogil:
738 status = self._st.record_sync_info(self._st, source_replica_uid,746 status = self._st.record_sync_info(
739 source_gen, source_trans_id)747 self._st, c_source_replica_uid, c_source_gen,
748 c_source_trans_id)
740 handle_status("record_sync_info", status)749 handle_status("record_sync_info", status)
741750
742 def _get_sync_exchange(self, source_replica_uid, source_gen):751 def _get_sync_exchange(self, source_replica_uid, source_gen):
@@ -804,6 +813,7 @@
804 cdef int *generations = NULL813 cdef int *generations = NULL
805 cdef const_char_ptr *trans_ids = NULL814 cdef const_char_ptr *trans_ids = NULL
806 cdef char *target_trans_id = NULL815 cdef char *target_trans_id = NULL
816 cdef char *c_source_replica_uid = NULL
807 cdef int i, count, status, target_gen817 cdef int i, count, status, target_gen
808818
809 self._check()819 self._check()
@@ -828,9 +838,10 @@
828 target_gen = last_known_generation838 target_gen = last_known_generation
829 if last_known_trans_id is not None:839 if last_known_trans_id is not None:
830 target_trans_id = last_known_trans_id840 target_trans_id = last_known_trans_id
841 c_source_replica_uid = source_replica_uid
831 with nogil:842 with nogil:
832 status = self._st.sync_exchange(843 status = self._st.sync_exchange(
833 self._st, source_replica_uid, count, docs, generations,844 self._st, c_source_replica_uid, count, docs, generations,
834 trans_ids, &target_gen, &target_trans_id,845 trans_ids, &target_gen, &target_trans_id,
835 <void *>return_doc_cb, return_doc_cb_wrapper)846 <void *>return_doc_cb, return_doc_cb_wrapper)
836 handle_status("sync_exchange", status)847 handle_status("sync_exchange", status)

Subscribers

People subscribed via source and target branches