Skip to content
Snippets Groups Projects
  • Joshua Colp's avatar
    d17d9a92
    json: Audit ast_json_* usage for thread safety. · d17d9a92
    Joshua Colp authored
    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
    d17d9a92
    History
    json: Audit ast_json_* usage for thread safety.
    Joshua Colp authored
    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