     userSuccessFn: cb or ->
     userFailureFn: errb or ->
 
-  bootstrap()
+  bootstrapUnlock 'init'
+
 
 _hull = window.Hull =
   on:      createPool('events')

_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]


  _hull


# Wraps the failure callback
# * Executes the failure behaviour defined by the current flavour
failureCb = (args...)->
  currentFlavour.failure(args...)
  _setup.userFailureFn(args...)

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
  bootstrapUnlock 'require'

