Release semaphore even in case of error

This commit is contained in:
Tony Garnock-Jones 2016-08-02 19:14:20 -04:00
parent 9daeb78cd7
commit 9fe90a5c54

View File

@ -172,9 +172,12 @@
(define (put/bytes^ p cb mt h)
(semaphore-wait put-bytes-sema)
(thread
(λ ()
(put/bytes p cb mt h)
(semaphore-post put-bytes-sema))))
(lambda ()
(with-handlers ((values (lambda (e)
(semaphore-post put-bytes-sema)
(raise e))))
(put/bytes p cb mt h)
(semaphore-post put-bytes-sema)))))
(define (aws-put-file! index absolute-path content-bytes mime-type [headers '()])
(define relative-path (absolute-path->relative-path absolute-path))