Skip to content

Commit 190b6b9

Browse files
committed
Prefer snake_case for changed lines
1 parent 4de581a commit 190b6b9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

system/lib/libc/musl/src/thread/__timedwait.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ int __timedwait_cp(volatile int *addr, int val,
6262
int is_runtime_thread = emscripten_is_main_runtime_thread();
6363

6464
// Main runtime thread may need to run proxied calls, so sleep in very small slices to be responsive.
65-
double maxMsecsToSleep = is_runtime_thread ? 1 : 100;
65+
double max_msecs_to_sleep = is_runtime_thread ? 1 : 100;
6666

6767
// cp suffix in the function name means "cancellation point", so this wait can be cancelled
6868
// by the users unless current threads cancelability is set to PTHREAD_CANCEL_DISABLE
@@ -80,7 +80,7 @@ int __timedwait_cp(volatile int *addr, int val,
8080
}
8181
// Must wait in slices in case this thread is cancelled in between.
8282
r = -emscripten_futex_wait((void*)addr, val,
83-
msecsToSleep > maxMsecsToSleep ? maxMsecsToSleep : msecsToSleep);
83+
msecsToSleep > max_msecs_to_sleep ? max_msecs_to_sleep : msecsToSleep);
8484
// Assist other threads by executing proxied operations that are effectively singlethreaded.
8585
if (is_runtime_thread) emscripten_main_thread_process_queued_calls();
8686

system/lib/libc/musl/src/thread/__wait.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void __wait(volatile int *addr, volatile int *waiters, int val, int priv)
1818
int is_runtime_thread = emscripten_is_main_runtime_thread();
1919

2020
// Main runtime thread may need to run proxied calls, so sleep in very small slices to be responsive.
21-
double maxMsecsToSleep = is_runtime_thread ? 1 : 100;
21+
double max_msecs_to_sleep = is_runtime_thread ? 1 : 100;
2222

2323
while (*addr==val) {
2424
if (is_runtime_thread || pthread_self()->cancelasync == PTHREAD_CANCEL_ASYNCHRONOUS) {
@@ -29,7 +29,7 @@ void __wait(volatile int *addr, volatile int *waiters, int val, int priv)
2929
return;
3030
}
3131
// Must wait in slices in case this thread is cancelled in between.
32-
e = emscripten_futex_wait((void*)addr, val, maxMsecsToSleep);
32+
e = emscripten_futex_wait((void*)addr, val, max_msecs_to_sleep);
3333
// Assist other threads by executing proxied operations that are effectively singlethreaded.
3434
if (is_runtime_thread) emscripten_main_thread_process_queued_calls();
3535
} while (e == -ETIMEDOUT);

system/lib/pthread/library_pthread.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,20 @@ void emscripten_thread_sleep(double msecs) {
9494
emscripten_conditional_set_current_thread_status(
9595
EM_THREAD_STATUS_RUNNING, EM_THREAD_STATUS_SLEEPING);
9696

97-
double msecsToSleep;
97+
double msecs_to_sleep;
9898
do {
9999
// Keep processing the main loop of the calling thread.
100100
__pthread_testcancel(); // pthreads spec: sleep is a cancellation point, so must test if this
101101
// thread is cancelled during the sleep.
102102
emscripten_current_thread_process_queued_calls();
103103

104-
msecsToSleep = target - emscripten_get_now();
105-
if (msecsToSleep < minimumTimeSliceToSleep)
104+
msecs_to_sleep = target - emscripten_get_now();
105+
if (msecs_to_sleep < minimumTimeSliceToSleep)
106106
continue;
107107

108108
emscripten_futex_wait(&dummyZeroAddress, 0,
109-
msecsToSleep > maxMsecsSliceToSleep ? maxMsecsSliceToSleep : msecsToSleep);
110-
} while (msecsToSleep > 0);
109+
msecs_to_sleep > maxMsecsSliceToSleep ? maxMsecsSliceToSleep : msecs_to_sleep);
110+
} while (msecs_to_sleep > 0);
111111

112112
emscripten_conditional_set_current_thread_status(
113113
EM_THREAD_STATUS_SLEEPING, EM_THREAD_STATUS_RUNNING);

0 commit comments

Comments
 (0)