Remove _pthread_isduecanceled in favor of ->cancel. NFC. (#15625)
This commit is contained in:
Родитель
8077b19f7e
Коммит
9cfcefb54d
|
@ -38,10 +38,6 @@ static int __futex4_cp(volatile void *addr, int op, int val, const struct timesp
|
|||
static volatile int dummy = 0;
|
||||
weak_alias(dummy, __eintr_valid_flag);
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
int _pthread_isduecanceled(struct pthread *pthread_ptr);
|
||||
#endif
|
||||
|
||||
int __timedwait_cp(volatile int *addr, int val,
|
||||
clockid_t clk, const struct timespec *at, int priv)
|
||||
{
|
||||
|
@ -73,7 +69,7 @@ int __timedwait_cp(volatile int *addr, int val,
|
|||
pthread_self()->cancelasync == PTHREAD_CANCEL_ASYNCHRONOUS) {
|
||||
double sleepUntilTime = emscripten_get_now() + msecsToSleep;
|
||||
do {
|
||||
if (_pthread_isduecanceled(pthread_self())) {
|
||||
if (pthread_self()->cancel) {
|
||||
// Emscripten-specific return value: The wait was canceled by user calling
|
||||
// pthread_cancel() for this thread, and the caller needs to cooperatively
|
||||
// cancel execution.
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
|
||||
#include "pthread_impl.h"
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
int _pthread_isduecanceled(struct pthread *pthread_ptr);
|
||||
#endif
|
||||
|
||||
void __wait(volatile int *addr, volatile int *waiters, int val, int priv)
|
||||
{
|
||||
int spins=100;
|
||||
|
@ -25,7 +21,7 @@ void __wait(volatile int *addr, volatile int *waiters, int val, int priv)
|
|||
// Must wait in slices in case this thread is cancelled in between.
|
||||
int e;
|
||||
do {
|
||||
if (_pthread_isduecanceled(pthread_self())) {
|
||||
if (pthread_self()->cancel) {
|
||||
if (waiters) a_dec(waiters);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -8,15 +8,11 @@
|
|||
#include "pthread_impl.h"
|
||||
#include <pthread.h>
|
||||
|
||||
int _pthread_isduecanceled(struct pthread* pthread_ptr) {
|
||||
return pthread_ptr->cancel != 0;
|
||||
}
|
||||
|
||||
void __pthread_testcancel() {
|
||||
struct pthread* self = pthread_self();
|
||||
if (self->canceldisable)
|
||||
return;
|
||||
if (_pthread_isduecanceled(self)) {
|
||||
if (self->cancel) {
|
||||
pthread_exit(PTHREAD_CANCELED);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ $_emscripten_thread_exit
|
|||
$_emscripten_thread_free_data
|
||||
$_emscripten_thread_init
|
||||
$_main_thread
|
||||
$_pthread_isduecanceled
|
||||
$a_cas
|
||||
$a_dec
|
||||
$a_inc.1
|
||||
|
|
|
@ -1 +1 @@
|
|||
17782
|
||||
17701
|
||||
|
|
Загрузка…
Ссылка в новой задаче