 
   _hull
 
+
 # Wraps the failure callback
 # * Executes the failure behaviour defined by the current flavour
 failureCb = (args...)->
   currentFlavour.failure(args...)
   _setup.userFailureFn(args...)
 
-bootstrap = ()->
-  return unless _setup and currentFlavour
+bootstrapUnlock = createLock ['init', 'require'], ->
   currentFlavour.condition(_setup.config).then(successCb, failureCb)
 
 require ['flavour', 'underscore', 'lib/utils/version'], (flavour, _, version)->
   _hull.version = version
   _extend = _.extend
   currentFlavour = flavour
-  bootstrap()
+  bootstrapUnlock 'require'
 

_pool = {}
_setup = null
_extend = null
currentFlavour = null

# Helpers to manage the calls to functions defined from the start
# event if they are not available
createPool = (name)->
  _pool[name]  = {} unless _pool[name]
  _p = _pool[name]

    userSuccessFn: cb or ->
    userFailureFn: errb or ->

  bootstrapUnlock 'init'


_hull = window.Hull =
  on:      createPool('events')
