OSDN Git Service
OC2 oscl registry race condition
The idea is to only initialize the singleton table for once and only once and keep it around forever.
As a result, the lock for locking the whole singleton table is not needed and thus removed in this change.
This approach works only if the client program follows the protocol for using the singleton:
it must call initialize() first and then call the rest methods in this class.
- changed the pointer to a singletontable to be a static object so that it is initialized statically
- removed an extra lock on the whole singletontable, since we don't need it
- moved initialize and cleanup to the header file for optimization. actually, these two methods can be removed. I put the removal of
these two methods as a FIXME.