zephyr/lib/os
Andy Ross 9a594a0c1a lib/p4wq: Fix race with completed work items
Work items can be legally resubmitted from within their own handler.
Currently the p4wq detects this case by checking their thread field to
see if it's been set to NULL.  But that's a race, because if the item
was NOT resubmitted then it no longer belongs to the queue and may
have been freed or reused or otherwise clobbered legally by user code.

Instead, steal a single bit in the thread struct for this purpose.
This patch adds a K_CALLBACK_STATE bit in user_options and documents
it in such a way (as being intended for "callback manager" utilities)
that it can't be used recursively or otherwise collide.

Fixes #32052

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-14 18:17:28 -05:00
..
assert.c assert: Completely remove file info and condition expression 2020-01-13 13:59:55 +01:00
base64.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
cbprintf.c lib: cbprintf: add libc f/printf substitutes 2021-01-27 13:34:06 -05:00
cbprintf_complete.c lib: cbprintf: avoid referencing distinct union fields in a statement 2021-01-27 16:45:38 -05:00
cbprintf_nano.c lib: cbprintf: remove cbprintf_arglen 2021-01-07 14:02:06 +01:00
CMakeLists.txt lib/os: P4 Work Queue: Pooled Parallel Preemptible Priority-based 2021-01-15 11:35:50 -05:00
crc7_sw.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
crc8_sw.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
crc16_sw.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
crc32_sw.c lib: crc32_sw: 4 bit at a time implementation 2021-01-24 14:24:48 -05:00
dec.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
fdtable.c lib: fdtable: fix z_free_fd multiple calls fd leak 2020-09-10 16:04:36 -05:00
heap-validate.c lib/os/heap: make "solo free headers" into first-class citizens 2020-07-14 19:35:52 -04:00
heap.c lib/os/heap: fix out-of-bounds usage of memcpy() in sys_heap_realloc() 2021-02-02 19:08:24 -05:00
heap.h lib/os/heap: introduce option to force big heap mode 2021-01-24 10:11:11 -05:00
hex.c lib: hex: Remove constant expression 2020-09-02 13:45:50 -04:00
json.c misc: Replace assert include and calls by sys/__assert.h equivalent 2020-10-02 11:42:40 +02:00
Kconfig lib/os/heap: introduce option to force big heap mode 2021-01-24 10:11:11 -05:00
Kconfig.cbprintf lib: add cbprintf capability 2020-11-13 06:38:01 -05:00
mutex.c kernel/timeout: Make timeout arguments an opaque type 2020-03-31 19:40:47 -04:00
notify.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
onoff.c code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
p4wq.c lib/p4wq: Fix race with completed work items 2021-02-14 18:17:28 -05:00
printk.c lib/os: replace z_vprintk with cbprintf 2020-11-13 06:38:01 -05:00
rb.c cleanup: include/: move misc/rb.h to sys/rb.h 2019-06-27 22:55:49 -04:00
ring_buffer.c tests: ringbuffer: code coverage improvements 2021-01-18 23:12:47 -05:00
sem.c code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
thread_entry.c lib: os: remove dead code 2019-06-18 09:08:01 -04:00
timeutil.c lib/timeutil: add utilities to manage local/reference clock alignment 2021-01-20 16:38:56 -05:00
work_q.c os: work_q: Use NULL instead of 0 2020-09-02 13:45:50 -04:00