Skip to content

Commit da4bff9

Browse files
gonnetxnnpack-bot
authored andcommitted
Don't re-generate man-db after sudo apt update in the workflows.
PiperOrigin-RevId: 802542098
1 parent 7d53b52 commit da4bff9

2 files changed

Lines changed: 34 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v4
2727
- name: Update apt
28-
run: sudo apt update
28+
run: |
29+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
30+
sudo dpkg-reconfigure man-db
31+
sudo apt update
2932
- name: Install ninja
3033
run: sudo apt install ninja-build
3134
- name: Setup ccache
@@ -53,7 +56,10 @@ jobs:
5356
steps:
5457
- uses: actions/checkout@v4
5558
- name: Update apt
56-
run: sudo apt update
59+
run: |
60+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
61+
sudo dpkg-reconfigure man-db
62+
sudo apt update
5763
- name: Install ninja
5864
run: sudo apt install ninja-build
5965
- name: Setup ccache
@@ -199,8 +205,10 @@ jobs:
199205
timeout-minutes: 60
200206
steps:
201207
- uses: actions/checkout@v4
202-
- name: Update apt
203-
run: sudo apt update
208+
run: |
209+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
210+
sudo dpkg-reconfigure man-db
211+
sudo apt update
204212
- name: Install ninja
205213
run: sudo apt install ninja-build
206214
- name: Setup Android NDK
@@ -280,7 +288,10 @@ jobs:
280288
steps:
281289
- uses: actions/checkout@v4
282290
- name: Update apt
283-
run: sudo apt update
291+
run: |
292+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
293+
sudo dpkg-reconfigure man-db
294+
sudo apt update
284295
- name: Install clang-18
285296
working-directory: ${{ github.workspace }}
286297
run: |
@@ -320,7 +331,10 @@ jobs:
320331
steps:
321332
- uses: actions/checkout@v4
322333
- name: Update apt
323-
run: sudo apt update
334+
run: |
335+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
336+
sudo dpkg-reconfigure man-db
337+
sudo apt update
324338
- name: Install clang-18
325339
working-directory: ${{ github.workspace }}
326340
run: |
@@ -363,7 +377,10 @@ jobs:
363377
steps:
364378
- uses: actions/checkout@v4
365379
- name: Update apt
366-
run: sudo apt update
380+
run: |
381+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
382+
sudo dpkg-reconfigure man-db
383+
sudo apt update
367384
- name: Install gcc-9
368385
working-directory: ${{ github.workspace }}
369386
run: |

src/pthreads.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ static int futex_wait(pthreadpool_atomic_uint32_t* address, uint32_t value) {
9696
NULL);
9797
}
9898

99+
static int futex_wake_n(pthreadpool_atomic_uint32_t* address, uint32_t n) {
100+
return syscall(SYS_futex, address, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, n);
101+
}
102+
99103
static int futex_wake_all(pthreadpool_atomic_uint32_t* address) {
100-
return syscall(SYS_futex, address, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, INT_MAX);
104+
return futex_wake_n(address, /*n=*/INT_MAX);
101105
}
102106
#elif defined(__EMSCRIPTEN__)
103107
static int futex_wait(pthreadpool_atomic_uint32_t* address, uint32_t value) {
@@ -280,10 +284,11 @@ static void signal_num_recruited_threads(pthreadpool_t threadpool) {
280284
static void signal_num_active_threads(pthreadpool_t threadpool,
281285
uint32_t max_num_waiting) {
282286
#if PTHREADPOOL_USE_FUTEX
283-
if (pthreadpool_load_consume_uint32_t(&threadpool->num_waiting_threads) >
284-
max_num_waiting) {
285-
futex_wake_all(
286-
(pthreadpool_atomic_uint32_t*)&threadpool->num_active_threads);
287+
const uint32_t num_waiting_threads =
288+
pthreadpool_load_consume_uint32_t(&threadpool->num_waiting_threads);
289+
if (num_waiting_threads > max_num_waiting) {
290+
futex_wake_n((pthreadpool_atomic_uint32_t*)&threadpool->num_active_threads,
291+
num_waiting_threads - max_num_waiting);
287292
}
288293
#else
289294
pthread_mutex_lock(&threadpool->num_active_threads_mutex);

0 commit comments

Comments
 (0)