Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- singleton* singleton::instance() {
- singleton* temp = pInstance;
- if (temp == 0) {
- scoped_lock l;
- if (pInstance == 0) {
- temp = new singleton;
- write_memory_barrier();
- pInstance = temp;
- }
- }
- return pInstance;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement