vlc/include
Thomas Guillem 90e98b012e vlc_queue: fix restrict violation
`restrict` tells the compiler that the tombstone pointer is the only way
to access the variable pointed by it. This is not case with multi-threading.

From the C11 specs:

§ 6.7.3 item 8
    An object that is accessed through a restrict-qualified pointer has
    a special association with that pointer. This association, defined
    in 6.7.3.1 below, requires that all accesses to that object use,
    directly or indirectly, the value of that particular pointer.

§ 6.7.3.1 item 4
    Every other lvalue used to access the value of X shall also have its
    address based on P.

Also set the pointer to const.

Fixes the following race condition when closing live555:

Thread 80 (Thread 28393.4880):
0  0x0000007953dbebbc in syscall () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
1  0x0000007855d2c0ec in sys_futex (addr=0x89, op=137, val=0, to=0x0, addr2=0x0, val3=-1) at ../../src/linux/thread.c:82
2  vlc_futex_wait (addr=0x89, flags=0, val=0, to=0x0) at ../../src/linux/thread.c:93
3  vlc_atomic_wait (addr=0x89, val=0) at ../../src/linux/thread.c:109
4  0x0000007855d20e9c in vlc_cond_wait (cond=cond@entry=0x7829f26ce8, mutex=mutex@entry=0x7829f26cd8) at ../../src/misc/threads.c:298
5  0x0000007855d42244 in vlc_queue_Wait (q=0x7829f26cc0) at ../../include/vlc_queue.h:122
6  vlc_queue_DequeueKillable (q=0x7829f26cc0, tombstone=0x7829f26d00) at ../../include/vlc_queue.h:248
7  vlc_stream_fifo_Block (s=<optimized out>, eof=0x78709a8838) at ../../src/input/stream_fifo.c:75
8  0x0000007855cfa160 in vlc_stream_ReadRaw (s=s@entry=0x7819411360, buf=buf@entry=0x78c4393c80, len=len@entry=188) at ../../src/input/stream.c:466
9  0x0000007855cf9fe0 in vlc_stream_ReadPartial (s=s@entry=0x7819411360, buf=buf@entry=0x78c4393c80, len=len@entry=188) at ../../src/input/stream.c:489
10 0x0000007855cfad44 in vlc_stream_Read (s=<optimized out>, buf=0x78c4393c80, len=188) at ../../src/input/stream.c:504
11 vlc_stream_Block (s=0x7819411360, size=<optimized out>) at ../../src/input/stream.c:909
12 0x0000007855f1fe5c in ReadTSPacket (p_demux=p_demux@entry=0x78c42c0ce0) at ../../modules/demux/mpeg/ts.c:1808
13 0x0000007855f1de30 in Demux (p_demux=<optimized out>) at ../../modules/demux/mpeg/ts.c:649
4 0x0000007855d41e4c in vlc_demux_chained_Thread (data=0x7829f26c70) at ../../src/input/demux_chained.c:96
15 0x0000007855d2d5b8 in joinable_thread (data=0x7823341ea0) at ../../src/android/thread.c:96
16 0x0000007953e217c4 in __pthread_start(void*) () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
17 0x0000007953dc41ac in __start_thread () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so

Thread 79 (Thread 28393.4875):
0  0x0000007953dbebbc in syscall () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
1  0x0000007953e21d98 in pthread_join () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
2  0x0000007855d2d204 in vlc_join (handle=0x7823341ea0, result=0x0) at ../../src/android/thread.c:147
3  0x0000007855d4202c in vlc_demux_chained_Delete (dc=0x7829f26c70) at ../../src/input/demux_chained.c:167
4  0x0000007855d3d92c in Close (p_this=<optimized out>) at ../../modules/access/live555.cpp:505
5  0x0000007855cb49dc in module_unneed (obj=obj@entry=0x78194110c0, module=0x78c83b0520) at ../../src/modules/modules.c:305
6  0x0000007855ceae78 in vlc_access_Destroy (access=0x78194110c0) at ../../src/input/access.c:54
7  0x0000007855cf958c in vlc_stream_Delete (s=0x78194110c0) at ../../src/input/stream.c:150
8  0x0000007855ce4954 in demux_Delete (demux=0x78709a8d60) at ../../include/vlc_demux.h:291
9  InputSourceDestroy (in=0x781a3aa780) at ../../src/input/input.c:2852
10 0x0000007855ce39f0 in End (p_input=p_input@entry=0x7863073c00) at ../../src/input/input.c:1413
11 0x0000007855ce0620 in Run (data=0x7863073c00) at ../../src/input/input.c:431
12 0x0000007855d2d5b8 in joinable_thread (data=0x78231b02c0) at ../../src/android/thread.c:96
13 0x0000007953e217c4 in __pthread_start(void*) () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
14 0x0000007953dc41ac in __start_thread () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
2023-03-17 08:10:38 +00:00
..
vlc libvlc: use the local includes in vlc.h 2023-03-14 09:53:54 +00:00
.gitignore
meson.build meson: fix named argument style 2023-01-15 09:26:33 +00:00
vlc_access.h access: set all callback fields in ACCESS_SET_CALLBACKS 2023-02-04 15:22:27 +00:00
vlc_actions.h actions: shift special keys to make space 2021-11-17 16:42:06 +00:00
vlc_addons.h Remove stray <vlc_events.h> #include's 2020-08-26 18:20:32 +03:00
vlc_ancillary.h core: add missing include to vlc_ancillary.h 2022-06-03 11:11:46 +00:00
vlc_aout.h vlc_aout: add restrict qualifier to match existing callbacks 2023-01-27 07:25:24 +00:00
vlc_aout_volume.h objects: merge vlc_object_t and vlc_common_members 2019-04-14 22:24:33 +03:00
vlc_arrays.h remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
vlc_atomic.h core: static initializer for refcount 2022-03-10 15:12:55 +00:00
vlc_avcodec.h
vlc_bits.h vlc_bits: remove bs_remain 2020-07-24 11:22:55 +02:00
vlc_block.h block: remove BLOCK_FLAG_CLOCK 2022-11-11 10:02:46 +00:00
vlc_block_helper.h vlc_block_helper: fix offset peek 2017-07-22 01:44:06 +02:00
vlc_boxes.h vlc_boxes: add bo_size 2018-01-25 14:28:55 +01:00
vlc_charset.h text: let vlc_towc() return an ssize_t 2023-02-17 08:20:49 +00:00
vlc_clock.h clock: publicly expose clock's typedefs 2023-02-03 16:55:34 +00:00
vlc_codec.h gstdecode: add dummy video context and dummy decoder device 2022-12-20 15:00:25 +00:00
vlc_codecs.h vlc_codecs: assert that our WAVE_FORMAT values match the SDK ones 2023-02-28 13:51:20 +00:00
vlc_common.h vlc_common: remove redirections to mingw printf functions 2023-01-31 09:11:53 +00:00
vlc_config.h config: remove unused define 2019-06-11 07:47:24 +02:00
vlc_config_cat.h prefs: use common defines for all simple pref tab titles & tooltips 2022-02-01 13:20:23 +00:00
vlc_configuration.h config: use libvlc_int_t directly 2022-08-22 05:03:46 +00:00
vlc_cpu.h cpu: properly indent x86 defines 2023-02-26 20:15:02 +00:00
vlc_cxx_helpers.hpp vlc_shared_data_ptr: accept implicit ctor for null 2022-10-01 04:29:53 +00:00
vlc_decoder.h input_decoder: publicly expose `ChangeDelay` 2023-02-03 16:55:34 +00:00
vlc_demux.h demux: add more helper methods 2023-03-16 14:20:37 +00:00
vlc_dialog.h dialogs: split callbacks between interactive and non-interactive callbacks 2022-04-29 17:19:30 +00:00
vlc_diffutil.h diffutil: provide a generic diffutil implementation 2022-03-27 13:01:07 +00:00
vlc_epg.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_es.h vlc_es: add HDR10+ dynamic metadata 2023-02-16 17:47:05 +00:00
vlc_es_out.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_events.h vlc_events: add event type count define 2022-08-31 18:40:51 +00:00
vlc_executor.h executor: introduce new executor API 2020-10-23 16:34:09 +02:00
vlc_extensions.h vlc_extensions: add player reference 2023-02-11 20:32:36 +00:00
vlc_filter.h filter: constify config_chain_t parameter 2021-03-01 17:49:16 +01:00
vlc_fingerprinter.h objects: merge vlc_object_t and vlc_common_members 2019-04-14 22:24:33 +03:00
vlc_fixups.h vlc_fixups: define IN6ADDR_ANY_INIT on OS/2 2023-03-09 07:11:12 +00:00
vlc_fourcc.h fourcc: add GStreamer Memory opaque chroma 2022-12-20 15:00:25 +00:00
vlc_frame.h vlc_frame: use a const frame in vlc_frame_ChainProperties 2022-11-30 08:15:31 +00:00
vlc_fs.h vlc_fs: always map lseek to _lseeki64 on Windows 2023-01-07 22:21:26 +00:00
vlc_gcrypt.h gcrypt: require libgcrypt >= 1.6.0 2015-06-16 10:44:07 +02:00
vlc_hash.h src: remove old md5 API 2020-04-16 12:06:12 +02:00
vlc_http.h Remove old mail address from sources 2019-09-04 22:11:04 +03:00
vlc_httpd.h remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
vlc_image.h image: make the write URL output video format const 2019-02-08 14:00:32 +01:00
vlc_inhibit.h window: rename vout_window* to vlc_window* 2022-05-16 16:51:03 +00:00
vlc_input.h input: add a flag for main title 2022-06-08 07:11:06 +00:00
vlc_input_item.h input: add an option to force preparsing 2022-12-07 10:45:26 +00:00
vlc_interface.h Add 'amrec' file extension 2022-05-14 09:11:05 +00:00
vlc_interrupt.h vlc_interrupt: fix doxygen comments 2021-08-09 10:14:18 +00:00
vlc_intf_strings.h vlc_intf_strings: Rename 'Custom Bookmarks' to 'Bookmarks' 2022-03-18 19:47:57 +00:00
vlc_iso_lang.h iso639: tweak name-inclusive search algorithm to check names last 2021-06-12 13:09:35 +00:00
vlc_keystore.h keystore: change vlc_credential_get return type 2022-06-04 06:38:18 +00:00
vlc_list.h vlc_list: Don't initialize return value with a compound literal in C++ 2023-01-17 11:33:05 +00:00
vlc_media_library.h medialibrary: don't use named intializers in C++ 2023-02-10 18:18:54 +00:00
vlc_media_source.h media tree: make functions public 2022-10-11 11:04:00 +00:00
vlc_memstream.h memstream: document 2020-01-15 18:51:20 +02:00
vlc_messages.h vlc_messages: fix documentation referencing vlc_msg_SetCallback() 2022-06-23 17:08:30 +00:00
vlc_meta.h meta: add vlc_meta_TypeToString() 2022-05-19 18:33:26 +00:00
vlc_meta_fetcher.h objects: merge vlc_object_t and vlc_common_members 2019-04-14 22:24:33 +03:00
vlc_mime.h
vlc_modules.h modules: handle error in module_need_var() 2022-01-15 20:40:24 +00:00
vlc_mouse.h window: improve documentation 2019-02-18 20:37:13 +02:00
vlc_network.h vlc_network: define SHUT_xxx values on Windows if they are missing 2023-01-06 14:46:46 +00:00
vlc_objects.h vlc_objects: add VLC_OBJECT macro for vlc_object_release 2022-04-26 07:12:26 +00:00
vlc_opengl.h opengl: add an alpha config to the activate cb 2023-03-05 14:48:33 +00:00
vlc_opengl_interop.h opengl: remove init() callback from interop 2022-04-15 08:43:55 +00:00
vlc_pgpkey.h
vlc_picture.h vlc_picture: add C++ extern "C" 2023-01-17 10:37:49 +00:00
vlc_picture_fifo.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_picture_pool.h picture_pool: remove picture_pool_Cancel 2022-09-12 06:13:46 +00:00
vlc_player.h input: update capabilities on end and error 2022-09-17 07:25:44 +00:00
vlc_playlist.h vlc_playlist: Add FILE_SIZE and FILE_MODIFIED sort keys 2022-07-16 14:30:00 +00:00
vlc_playlist_export.h objects: merge vlc_object_t and vlc_common_members 2019-04-14 22:24:33 +03:00
vlc_plugin.h vlc_plugin: add a macro to declare module entries 2023-03-07 08:23:15 +00:00
vlc_probe.h objects: merge vlc_object_t and vlc_common_members 2019-04-14 22:24:33 +03:00
vlc_queue.h vlc_queue: fix restrict violation 2023-03-17 08:10:38 +00:00
vlc_rand.h remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
vlc_renderer_discovery.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_services_discovery.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_sort.h core: add vlc_qsort 2019-01-22 18:32:59 +01:00
vlc_sout.h sout: expose a light clock API 2023-02-03 16:55:34 +00:00
vlc_spawn.h vlc_spawn: use unistd.h to get pid_t 2023-01-17 11:33:05 +00:00
vlc_spu.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_stream.h demux: introduce typed operations for demux 2023-03-16 14:20:37 +00:00
vlc_stream_extractor.h vlc_stream_extractor: doc: capitalize warning 2022-04-13 02:51:32 +00:00
vlc_strings.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_subpicture.h filter: use a specific type for blend filters 2019-09-18 09:05:50 +02:00
vlc_text_style.h include: fix typos 2022-01-08 15:19:32 +00:00
vlc_threads.h threads: add vlc_queuedmutex_held() 2022-08-08 20:36:51 +02:00
vlc_thumbnailer.h thumbnail: rework API to fix use-after-free 2023-01-27 08:18:54 +00:00
vlc_tick.h vlc_tick: use unsigned for sample frequency 2023-01-17 10:37:49 +00:00
vlc_timestamp_helper.h vlc_timestamp_helper: fix compilation from C++ modules 2022-03-16 08:51:05 +00:00
vlc_tls.h vlc_tls: add restrict qualifier to match existing callbacks 2023-01-27 07:25:24 +00:00
vlc_tracer.h vlc_tracer: fix union target member 2022-12-29 16:06:01 +00:00
vlc_update.h remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
vlc_url.h Improve Doxygen 2020-04-11 23:11:40 +03:00
vlc_variables.h variables: return size_t with var_CountChoices() 2023-02-10 18:18:54 +00:00
vlc_vector.h vlc_vector: assert count argument is not 0 2023-02-11 07:31:00 +00:00
vlc_video_splitter.h window: rename vout_window* to vlc_window* 2022-05-16 16:51:03 +00:00
vlc_viewpoint.h viewpoint: remove vlc_viewpoint_reverse 2021-01-13 16:54:07 +01:00
vlc_vlm.h vlm: remove unmaintained (RTSP) VoD support 2020-02-29 18:20:31 +01:00
vlc_vout.h video_output: remove vout_GetPicture 2022-11-04 13:27:07 +00:00
vlc_vout_display.h include: don't include vlc_actions.h from vlc_vout_display.h 2023-03-02 09:15:59 +00:00
vlc_vout_osd.h vlc_vout_osd: move documentation to header 2022-01-29 18:07:27 +00:00
vlc_window.h window: android: specify the surface id 2023-03-07 10:27:37 +00:00
vlc_xlib.h
vlc_xml.h objects: merge vlc_object_t and vlc_common_members 2019-04-14 22:24:33 +03:00