Go to file
Robert Knight 67106b169c Fix sporadic hang in QLocalServer::close() in OS X 10.7
There is a bug in CFSocket/CFRunLoopSource in OS X 10.7 which can lead to a deadlock
in CFRunLoopRemoveSource or CFRunLoopSourceInvalidate if the CFSocket manager thread
is concurrently calling CFSocketInvalidate as a result of the socket's file descriptor
having been closed.

QLocalServer::close() triggers this race by closing the socket fd before unregistering
the QSocketNotifier, which internally uses CFSocket.

This commit fixes the problem by changing the ordering in close() so that the socket notifier
is disabled before closing the file descriptor.  This change also makes QLocalServer::close()
perform operations in reverse order to QLocalServer::listen(), as would be expected.

Task-number: QTBUG-22789
Merge-request: 1470
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
(cherry picked from commit a9c3f7169faf4621d39714f753d6e8b376c5d6e5)
Change-Id: Ia9c3f7169faf4621d39714f753d6e8b376c5d6e5
2011-11-18 20:25:53 +01:00
bin Fix config tests for modules on Mac OS X 2011-11-14 23:42:17 +01:00
config.tests Added '-' parameter to fix strings command using gcc-llvm on Mac OS 10.6 w/ Xcode 4.2. 2011-11-08 01:13:40 +01:00
dist SSL namespace: rename TlsV1 to TlsV1_0 2011-11-16 10:32:10 +01:00
doc/src Fixed typo in QSettings documentation. 2011-11-18 20:25:53 +01:00
examples Compile fix for Mac OS X 10.7 with 10.6 sdk 2011-11-18 20:25:53 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs mkspecs: Case-insensitive check of paths on Windows. 2011-11-18 14:53:19 +01:00
qmake Add -nn for .cpp MOC preprocessing for INTEGRITY 2011-11-18 20:25:53 +01:00
src Fix sporadic hang in QLocalServer::close() in OS X 10.7 2011-11-18 20:25:53 +01:00
tests Improve diagnostics of QPluginLoader test. 2011-11-18 08:58:56 +01:00
tools configure.exe: Reduce size by using -O1 instead of -O2. 2011-11-18 17:18:55 +01:00
util Add valgrind suppression files. 2011-11-15 10:16:12 +01:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Update .gitignore 2011-11-08 17:20:39 +01:00
.gitmodules Add QtV8 library to QtBase 2011-08-29 10:16:01 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure configure: clean up whitespace, comments. 2011-11-18 01:51:57 +01:00
configure.exe Windows: Rebuild configure with support for V8 and -force-asserts. 2011-11-17 11:29:37 +01:00
header.BSD Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
header.FDL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL-ONLY Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
INSTALL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Fix make confclean 2011-09-12 16:03:47 +02:00
sync.profile Fix source incompatibility for QVariant{Map, Hash, List} 2011-11-14 18:41:17 +01:00