json: Audit ast_json_* usage for thread safety.
The JSON library Asterisk uses, jansson, is not thread safe for us in a few ways. To help with this wrappers for JSON object reference count increasing and decreasing were added which use a global lock to ensure they don't clobber over each other. This does not extend to reference count manipulation within the jansson library itself. This means you can't safely use the object borrowing specifier (O) in ast_json_pack and you can't share JSON instances between objects. This change removes uses of the O specifier and replaces them with the o specifier and an explicit ast_json_ref. Some cases of instance sharing have also been removed. ASTERISK-25601 #close Change-Id: I06550d8b0cc1bfeb56cab580a4e608ae4f1ec7d1
Showing
- main/aoc.c 10 additions, 10 deletionsmain/aoc.c
- main/loader.c 2 additions, 2 deletionsmain/loader.c
- main/rtp_engine.c 7 additions, 7 deletionsmain/rtp_engine.c
- main/stasis.c 2 additions, 2 deletionsmain/stasis.c
- main/stasis_channels.c 17 additions, 7 deletionsmain/stasis_channels.c
- res/res_fax.c 2 additions, 2 deletionsres/res_fax.c
- res/res_stasis.c 3 additions, 3 deletionsres/res_stasis.c
- res/res_stasis_playback.c 2 additions, 2 deletionsres/res_stasis_playback.c
- res/res_stasis_recording.c 2 additions, 2 deletionsres/res_stasis_recording.c
- res/stasis/app.c 2 additions, 2 deletionsres/stasis/app.c
Loading
Please register or sign in to comment