code: public void registerBThread(String name, Function func) {
          program.registerBThread(new BThreadSyncSnapshot(name, func));
      }
docs: Called from JS to add BThreads running func as their runnable code.
  
  @param name Name of the registered BThread (useful for debugging).
  @param func Script entry point of the BThread.
  
  @see #registerBThread(org.mozilla.javascript.Function)