• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

basilisp-lang / basilisp / 10539746224
99%

Build:
DEFAULT BRANCH: main
Ran 24 Aug 2024 04:10PM UTC
Jobs 1
Files 44
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Aug 2024 03:57PM UTC coverage: 98.876%. Remained the same
10539746224

push

github

web-flow
Notify all waiting threads on a promise delivery (#994)

Hi,

can you please consider patch to notify all waiting threads for a
promise delivery. It fixes #993

This patch addresses the issue where one or more threads waiting for the
delivery condition in `Promise.deref` were not being notified upon the
delivery. In the worst-case scenario, this could lead to threads
deadlocking while waiting indefinitely for the notification, or in the
case of a timeout, returning only after the timeout has expired.

I've added a test based on the originally reported scenario that checks
how long it takes for the delivery to be received.

The time it now takes for the original case to be notified of the
delivery is just above the sleep time of the secondary thread at 0.108
secs

```clojure
basilisp.user=> (import threading) (import time)
<module 'time' (built-in)>

basilisp.user=> (let [p (promise)
                      t (threading/Thread **
                                          :daemon true
                                          :target #(do
                                                     (println :1in)
                                                     (time/sleep 0.1)
                                                     (deliver p :hi)
                                                     (println :2in)
                                                     ))]
                  (.start t)
                  (let [start (time/time)
                        value (deref p 5 :time-out)]

                    (println :value value :duration-sec (- (time/time) start))))
:1in
:2in
:value :hi :duration-sec 0.10864090919494629
nil
```

Thanks

Relevant section in the python documentation about wait and release on a
conditional var at
https://docs.python.org/3/library/threading.html#condition-objects:

>Other methods must be called with the associated lock held. The
[wait()](https://docs.python.org/3/library/thread... (continued)

1832 of 1839 branches covered (99.62%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

8459 of 8569 relevant lines covered (98.72%)

0.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10539746224.1 24 Aug 2024 04:10PM UTC 0
98.88
GitHub Action Run
Source Files on build 10539746224
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #10539746224
  • 296aec60 on github
  • Prev Build on main (#10539640713)
  • Next Build on main (#10540108028)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc