Thread safety analysis clang docs and paper Suppose that you can specify that specific functions will be called only by specific threads. From the article:
#include "ThreadRole.h"
ThreadRole InputThread;
ThreadRole GUIThread;
class Widget {
public :
virtual void onClick() REQUIRES(InputThread);
virtual void draw() REQUIRES(GUIThread);
};
class Button : public Widget {
public :
void onClick() override {
depressed = true;
draw() ;
}
};
However, none of them indicate how you actually comment on ThreadRole
this to happen. What should look like ThreadRole
to make this work?
Barry source
share