Commit Graph

2 Commits (e417e204365c26b6d342dfd4e5696a66cdac6b4f)

Author SHA1 Message Date
Russ Butler fb3414fa43 Fix SingletonPtr problems
Check to see if ptr is NULL after acquiring the singleton lock to
prevent initialization race conditions. Also explicitly call the
constructor for type T.
2016-08-30 07:43:51 +01:00
Russ Butler 348b32c3c6 Create singleton class and update code to use it
Create the wrapper class SingletonPtr.  This provides a safe way to
declare and use singletons.  This class allows both the lazy
initialization of a singleton, and allows the singleton to be
garbage collected by the linker if it is never referenced.

This patch also updates the HAL to use SingletonPtr when declaring
singleton mutexes.
2016-07-15 14:37:43 -05:00