Hello, could somebody answer me if it is safe to use static QMutex on the stack of the function that is called by several threads (see the same code below). Static variables are created only once, but I'm afraid, perhaps, another thread may try to use it when it is not yet created.
Qt Code:
// safe or not? void testFunc() { static QMutex mutex; mutex.lock(); // access shared resource mutex.unlock(); }To copy to clipboard, switch view to plain text mode
Bookmarks