static void checkThreadSafety(Sema &S, AnalysisContext &AC) {
CFG *CFGraph = AC.getCFG();
if (!CFGraph) return;
+ const Decl *D = AC.getDecl();
+ if (D && D->getAttr<NoThreadSafetyAnalysisAttr>()) return;
Lockset::Factory LocksetFactory;
gb_field = 0; // \
// expected-warning {{writing variable 'gb_field' requires lock 'sls_mu' to be held exclusively}}
}
+
+ void testNoAnal() __attribute__((no_thread_safety_analysis)) {
+ gb_field = 0;
+ }
};
GBFoo GlobalGBFoo __attribute__((guarded_by(sls_mu)));
sls_mu.Unlock();
}
+void es_fun_8() __attribute__((no_thread_safety_analysis));
+
+void es_fun_8() {
+ Bar.aa_elr_fun_s();
+}
+
void es_bad_0() {
Bar.aa_elr_fun(); // \
// expected-warning {{calling function 'aa_elr_fun' requires exclusive lock 'aa_mu'}}