Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.5.0
-
None
-
c012ee2940bc087720b4aa0d257540921cf9a139
Description
In Debug mode, SIGNAL() and SLOT() are not threadsafe.
In Debug, the macro uses qFlagLocation():
- define METHOD(a) qFlagLocation("0"#a QLOCATION)
- define SLOT(a) qFlagLocation("1"#a QLOCATION)
- define SIGNAL(a) qFlagLocation("2"#a QLOCATION)
First, this function use a static integer for the index:
static int idx = 0;
This variable is subject to race condition.
Secondly, the variable "flagged_locations" is global and is subject to race condition.
These two problem can lead to erroneous error message when a connection cannot be made. They can be corrected by using thread local storage for the two variable.