gh-128421: make getters and setters of BaseException thread safe
#128728
+520
−89
BaseException thread safe
#128728