| < | February 2010 | |||||||
|---|---|---|---|---|---|---|---|---|
| S | M | T | W | T | F | S | ||
| 1 | 2 | 3 | 4 | 5 | 6 | |||
| 7 | 8 | 9 | 10 | 11 | 12 | 13 | ||
| 14 | 15 | 16 | 17 | 18 | 19 | 20 | ||
| 21 | 22 | 23 | 24 | 25 | 26 | 27 | ||
| 28 | ||||||||
Here is an implementation of a thread-safe* C++ singleton template. It's small, simple, and easy to use.
You can download the code snippet from here: Singleton.zip
* Only construction of the class instance created by the singleton is made thread-safe. Using members of the class are not specifically made thread-safe, and remains the programmers responsibility if necessary.
posted at: 21:00 | path: /Programming/OPB/Snippets | Permanent link to this entry | Add/View comments (1 existing)
Copyright ©2004-2009 O. Patrick Barnes. All rights reserved.