GNOME Bugzilla – Bug 734010
Unbreak repository tests on OpenBSD (rework blob state machine)
Last modified: 2019-02-22 03:52:06 UTC
Created attachment 282111 [details] [review] Rework synchronization around a state machine The 'repository' tests were failing on OpenBSD with a SIGABRT which led us to investigate the issue which seemed related to the strict mutex type on OpenBSD (unlocking an already locked mutex is forbidden). However, our "main threads developer" noticed several issues with the code surrounding it: "Rework synchronization around a state machine instead of trying to treat mutexes and condition variables like semaphores. Should reduce the low-level locking operations and eliminates the attempt to lock a mutex in one thread but unlock it another that violates POSIX requirements." The attached patch fixes the issues described. OK to push?
Created attachment 282113 [details] [review] Rework synchronization around a state machine Slightly tweak patch to undo function blob_chunk_cb() signature change.
Review of attachment 282113 [details] [review]: This is probably better to be reviewed by jesse, in the meantime please see the minor style comment I added. ::: libgit2-glib/ggit-blob-output-stream.c @@ +51,3 @@ + * CLOSED -> closed by outside thread or error, exit and set result + */ + enum { IDLE, SENDING, CANCELLED, CLOSED } state; please put the enum out of the struct with a typedef
Great work, definitely simpler/better! Sorry that it took some time to actually push it. I've made the small changes suggested by nacho as well as minor code style.