[Ace-users] [ace-bugs] UUID_Generator
Wim van den Boogaard
wim.van.den.boogaard at varianinc.com
Fri Aug 31 05:58:10 CDT 2007
ACE VERSION: 5.5.8 / 10
HOST MACHINE and OPERATING SYSTEM:
WinXP
TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
COMPILER NAME AND VERSION (AND PATCHLEVEL):
THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
specific file, simply state which one]:
config-win32.h
THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
use a link to a platform-specific file, simply state which one
(unless this isn't used in this case, e.g., with Microsoft Visual
C++)]:
CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
(used by MPC when you generate your own makefiles):
---
AREA/CLASS/EXAMPLE AFFECTED:
DOES THE PROBLEM AFFECT:
COMPILATION?
LINKING
EXECUTION
OTHER (please specify)?
SYNOPSIS:
Double UUID generated in a multi threaded application.
DESCRIPTION:
The method UUID_Generator::generateUUID is not thread safe in
respect to the combination uuid_state_.clockSequence
and timestamp.
The combination timestamp and clockSequence should be accessed
in a thread safe manner. The method
UUID_Generator::get_timestamp returns the timestamp thread safe,
but also modifies the uuid_state_.clockSequence.
The uuid_state_.clockSequence is accessed thread safe in
UUID_Generator::generateUUID, but could have been modified
between the moment get_timestamp is being done and the moment it
is being used.
REPEAT BY:
SAMPLE FIX/WORKAROUND:
Return the timestamp and clockSequence in a atomic manner via
the get_timestamp method. I added an other argument
to the get_timestamp.
void get_timestamp(UUID_time& timestamp, ACE_UINT16& clockSequence);
Return the actual clockSequence in the get_timestamp method.
More information about the Ace-users
mailing list