Debian Codegraph @

build/clang-plugin/tests/TestNoNewThreadsChecker.cpp

raw
1 // Dummy NS_NewNamedThread.
2 void NS_NewNamedThread(const char *aName) {}
3
4 void func_threads() {
5 // Test to see if the checker recognizes a bad name, and if it recognizes a
6 // name from the ThreadAllows.txt.
7 NS_NewNamedThread("A bad name"); // expected-error {{Thread name not recognized. Please use the background thread pool.}} expected-note {{NS_NewNamedThread has been deprecated in favor of background task dispatch via NS_DispatchBackgroundTask and NS_CreateBackgroundTaskQueue. If you must create a new ad-hoc thread, have your thread name added to ThreadAllows.txt.}}
8 NS_NewNamedThread("Checker Test");
9 }