What\'s the best way to create a singleton in C? A concurrent solution would be nice.
I am aware that C isn\'t the first language you would use for a singleton.
Just do
void * getSingleTon() { static Class object = (Class *)malloc( sizeof( Class ) ); return &object; }
which works in a concurrent environment too.