This is the proposed fix in #37.
Fix #37 #56
Reepca/Fix-#37 into master
Thanks! This one won't probably make it to 1.1.0. I believe it makes sense but I'd like to take a closer look.
A test case is missing, to aid with verifying whether the change works, to avoid regressions later, and to assist with verifying future changes in this area of the code.
@ -128,0 +125,4 @@
(lambda ()
(catch #t
(lambda ()
(call-with-values init
Spacing seems wonky, though maybe that's just a different tabs / space convention (does someone know the conventions used in Fibers?).
@ -128,0 +128,4 @@
(call-with-values init
(lambda vals (atomic-box-set! ret
(list 'ok vals)))))
(lambda args
Don't use catch, as it destroys all backtrace information. Instead use with-exception-handler which doesn't destroy it (maybe with a fallback to 'catch' for old versions of Guile if it's not Guile 2.2). If you go for with-exception-handler, also go for raise-continuable instead of raise-exception/raise, otherwise you accumulate raise-exception in the backtrace, which is harmless but noisy.
@ -128,0 +132,4 @@
(atomic-box-set! ret (list 'err args))
(apply throw args))))
;; Could be that this fiber was migrated away.
;; Make sure to wake up the main scheduler.
It doesn't make a huge difference, but for a tiny bit extra performance / less memory usage and simplicity, you could just drop the (list 'ok ...) prefix. Basically, just stuff the list in ret on success, and stuff #false in case of failure.
Nevermind, that's bogus because of exceptions.
The raise-continuable I mentioned would go here.
@ -128,0 +132,4 @@
(atomic-box-set! ret (list 'err args))
(apply throw args))))
;; Could be that this fiber was migrated away.
;; Make sure to wake up the main scheduler.
Actually, if you go for with-exception-handler / raise-style exceptions, then a condition and a list can be distinguished, OTOH in principle it's allowed to raise non-conditions, so maybe let's not.
This was unintentionally closed but I see that #37 is still relevant.
@reepca Would you be willing to take another look at the reviews you got back then?
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?