File npv/thdsws/local/code.frag.c changed (mode: 100644) (index 96d49b1..2028789) |
... |
... |
static long futex(atomic_u32 *uaddr, long futex_op, long val) |
7 |
7 |
{ |
{ |
8 |
8 |
return syscall(SYS_futex, uaddr, futex_op, val, 0, 0, 0); |
return syscall(SYS_futex, uaddr, futex_op, val, 0, 0, 0); |
9 |
9 |
} |
} |
10 |
|
|
|
11 |
10 |
static void do_work(struct thdsws_ctx_t *ctx, struct thdsws_ctx_private_t *ctx_priv) |
static void do_work(struct thdsws_ctx_t *ctx, struct thdsws_ctx_private_t *ctx_priv) |
12 |
11 |
{ |
{ |
13 |
12 |
ctx_priv->sws = sws_get_cached_ctx(ctx_priv->sws, |
ctx_priv->sws = sws_get_cached_ctx(ctx_priv->sws, |
|
... |
... |
static void do_work(struct thdsws_ctx_t *ctx, struct thdsws_ctx_private_t *ctx_p |
25 |
24 |
(uint8_t*const*)&ctx->scale.dst_slice, |
(uint8_t*const*)&ctx->scale.dst_slice, |
26 |
25 |
(int*)&ctx->scale.dst_stride); |
(int*)&ctx->scale.dst_stride); |
27 |
26 |
} |
} |
28 |
|
|
|
29 |
27 |
static void worker(struct thdsws_ctx_t *ctx, |
static void worker(struct thdsws_ctx_t *ctx, |
30 |
28 |
struct thdsws_ctx_private_t *ctx_priv) |
struct thdsws_ctx_private_t *ctx_priv) |
31 |
29 |
{ |
{ |
|
... |
... |
static void worker(struct thdsws_ctx_t *ctx, |
35 |
33 |
errno = 0; |
errno = 0; |
36 |
34 |
r = futex(&ctx_priv->futex, FUTEX_WAIT, IDLE); |
r = futex(&ctx_priv->futex, FUTEX_WAIT, IDLE); |
37 |
35 |
if (r == -1) { |
if (r == -1) { |
38 |
|
if (errno == EINTR) /* SIGSTOP/SIGCONT/etc */ |
|
|
36 |
|
if (errno == EINTR || errno == EAGAIN) /* SIGSTOP/SIGCONT/etc */ |
39 |
37 |
return; |
return; |
40 |
|
/* include EAGAIN */ |
|
41 |
38 |
FATALTSW("unable to wait on futex:%s\n", strerror(errno)); |
FATALTSW("unable to wait on futex:%s\n", strerror(errno)); |
42 |
39 |
} |
} |
43 |
40 |
|
|
|
... |
... |
static void worker(struct thdsws_ctx_t *ctx, |
55 |
52 |
*/ |
*/ |
56 |
53 |
atomic_store(&ctx_priv->futex, IDLE); |
atomic_store(&ctx_priv->futex, IDLE); |
57 |
54 |
} |
} |
58 |
|
|
|
59 |
55 |
static void *worker_entry(void *arg) |
static void *worker_entry(void *arg) |
60 |
56 |
{ |
{ |
61 |
57 |
int r; |
int r; |