>>I'm handling it using this code:
>>
>>
>>public static class Bootstrapper
>> {
>> private static readonly object _lock = new object();
>> private static bool _initialized;
>>
>> public static void Bootstrap()
>> {
>> if (!_initialized)
>> {
>> lock (_lock)
>> {
>> if (!_initialized)
>> {
>> _initialized = true;
>>
>> StructureMapConfiguration.Initialize();
>>
>> var startupTasks = ObjectFactory.GetAllInstances<IStartupTask>();
>>
>> startupTasks.Each(task => task.Execute());
>> }
>> }
>> }
>> }
>> }
>>
>>
>>I call this in my Application_Start event in the global.asax file. Looks like we had the same concern, but I'm handling it a bit differently by checking the _initialized variable before and after the lock.
>
>The reason I do not need to check it at first, before the lock, is because I have lFirstHit. So, basically, we have the same code.
>
>Thanks
FWIW, I've used this same code several times with no issues, so I imagine the logic is sound.