Instead of always searching from the end of the range [User, MaxUser],
cache the next available id and start searching from there.
Instead of saving the already-allocated IDs in a QSet, use an atomic
bit-field. This removes the need to use a mutex.
The QBasicAtomicBitField class is designed to be reusable, but lacks
features that are not needed by QEvent::registerEventType(). It is
also unclear how this could be made more encapsulated without losing
the property that the whole instance is placed in the BSS segment,
since making the data fields private will make the type non-POD.
Change-Id: I4012fa114d9d9e85e9e881e100a2c021fa09a0d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>