Go to file
Bradley T. Hughes 6b82798ee7 Add QFreeList as an internal class
This is a generic implementation of the lock-free free list found in
qabstracteventdispatcher.cpp. Use next() to get the next free entry in
the list, and release(id) when done with the id.

This version is templated and allows having a payload which can be
accessed using the id returned by next(). The payload is allocated and
deallocated automatically by the free list, but *NOT* when calling
next()/release(). Initialization should be done by code needing it after
next() returns. Likewise, cleanup should happen before calling
release(). It is possible to have use 'void' as the payload type, in
which case the free list only contains indexes to the next free entry.

Autotest included.

Change-Id: Ifd12a961d47f3d76593c45061f72e55c9b80a43b
Reviewed-on: http://codereview.qt.nokia.com/2160
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
2011-07-26 13:40:07 +02:00
bin Add rudimentary config.test support when configuring modules. 2011-07-22 14:59:08 +02:00
config.profiles Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
config.tests Fixed opengldesktop configure test for mac. 2011-07-05 05:17:35 +02:00
dist Changed QLibrary::resolve() to return a function pointer. 2011-07-25 12:58:23 +02:00
doc/src Doc: Added missing license headers for documentation and examples. 2011-07-20 15:12:53 +02:00
examples Doc: Speculative attempt to fix build breakage. 2011-07-21 08:54:05 +02:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Add rudimentary config.test support when configuring modules. 2011-07-22 14:59:08 +02:00
qmake Make qmake load default_pre.prf for each project, like default_post.prf 2011-07-21 20:40:51 +02:00
src Add QFreeList as an internal class 2011-07-26 13:40:07 +02:00
tests Add QFreeList as an internal class 2011-07-26 13:40:07 +02:00
tools Always assume IPv6 support 2011-07-04 14:32:41 +02:00
util drop an obsolete QChar::NoCategory enum value 2011-07-13 13:31:13 +02:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Add QT_xxx_VERSION macros for each library in qtbase 2011-05-10 15:15:15 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Always assume IPv6 support 2011-07-04 14:32:41 +02:00
configure.exe New configure.exe binary 2011-05-23 09:24:19 -05: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 Remove all references to demos. 2011-06-23 14:03:31 +02:00
sync.profile Update sync.profile dependencies to new syntax 2011-07-07 12:30:00 +02:00