(&self)
| 1880 | } |
| 1881 | |
| 1882 | fn record_active(&self) { |
| 1883 | let active = self.active.fetch_add(1, Ordering::SeqCst) + 1; |
| 1884 | let mut observed = self.max_active.load(Ordering::SeqCst); |
| 1885 | while active > observed { |
| 1886 | match self.max_active.compare_exchange( |
| 1887 | observed, |
| 1888 | active, |
| 1889 | Ordering::SeqCst, |
| 1890 | Ordering::SeqCst, |
| 1891 | ) { |
| 1892 | Ok(_) => break, |
| 1893 | Err(next) => observed = next, |
| 1894 | } |
| 1895 | } |
| 1896 | } |
| 1897 | } |
| 1898 | |
| 1899 | struct LimitedConcurrencyLlmClient { |