Skip to content

Commit

Permalink
qmake: do not exclusively lock files for reading on Windows/MSVC
Browse files Browse the repository at this point in the history
When sifting through a file to find Q_OBJECT and friends, qmake
was locking it for reading and writing (_SH_DENYRW).
This breaks parallel builds where multiple qmake instances might want
to scan the same file.
Changed the sharing constant to _SH_DENYNO, which doesn't lock the
file at all. This is consistent with the _sopen_s call in findDeps.

Change-Id: I9c0a06db7f580f411e79d9d96dd36a6d705679aa
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
Joerg Bornemann authored and The Qt Project committed Nov 23, 2012
1 parent 31e801d commit 7ff3939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qmake/generators/makefiledeps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
int fd;
#if defined(_MSC_VER) && _MSC_VER >= 1400
if (_sopen_s(&fd, fixPathForFile(file->file, true).local().toLocal8Bit().constData(),
_O_RDONLY, _SH_DENYRW, _S_IREAD) != 0)
_O_RDONLY, _SH_DENYNO, _S_IREAD) != 0)
fd = -1;
#else
fd = open(fixPathForFile(file->file, true).local().toLocal8Bit().constData(), O_RDONLY);
Expand Down

0 comments on commit 7ff3939

Please sign in to comment.