Dap: add locking around DapSync.library_syncs field (bgo#614039)
As the stacktrace in comment#3 of bug#614039 shows (https://bugzilla.gnome.org/show_bug.cgi?id=614039#c3) there may be more than one thread accessing this field, so we need locking around the code that modifies it and the code that iterates it. In regards to the Libraries property, as its public, we make it do a copy of the list before returning it to external consumers, but also locking while making the copy. Also, to prevent external consumers from modifying it (because they cannot hold the private lock), we make its type be IEnumerable instead of IList. This should prevent all data races around this field, and fixes the last part of bug bgo#614039.
Showing with 62 additions and 34 deletions