ashwathgan Posted July 15, 2015 Report Posted July 15, 2015 Hi all If I have something like follows:SC_MODULE(Test) { ... int t1; // Want this variable to be shared void tesst() { t1 = t1 +2; } SC_CTOR(Test) { SC_THREAD(tesst) } And then I create two instances of Test as Test *t1 = new ....; Test *t2 = new ... Then , how can make the varible "t1"shared by both the instances/ threads? In other words, I want this variable to be updated by both the threads. Thanks Quote
Dineshkumar Posted July 16, 2015 Report Posted July 16, 2015 Hi, You can make t1 as static variable. Regards, Dinesh. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.