anchor.diff:  -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
            terminate/2, code_change/3]).
   
  --record(state, {tasks}).
  +-record(state, {tid}).
   
   %%====================================================================
   %% API
   %%====================================================================
   %%--------------------------------------------------------------------
  -%% @spec start_link() -> {ok,Pid} | ignore | {error,Error}.
  -%%
   %% @doc
   %% Starts the server
  -%% @end
  -%%--------------------------------------------------------------------
  -start_link() ->
  -    gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
  -
  -%%--------------------------------------------------------------------
  +%%
  +%% @spec start_link(Tid::tid()) -> {ok,Pid} | ignore | {error,Error}
  +%% @end
  +%%--------------------------------------------------------------------
  +start_link(Tid) ->
  +    gen_server:start_link({local, ?SERVER}, ?MODULE, [Tid], []).
  +
  +%%--------------------------------------------------------------------
  +%% @doc
  +%%  Tell this server to shutdown.
   %% @spec shutdown() -> ok
  -%%
  -%% @doc
  -%%  Tell this server to shutdown.
   %% @end
   %%--------------------------------------------------------------------
   shutdown() ->
       gen_server:cast(?SERVER, shutdown).
   
   %%--------------------------------------------------------------------
  -%% @spec register_task(TaskName::atom(), TaskImpl::atom(), Deps::list(), Callable::bool(), Desc::string()) -> ok
  -%%
   %% @doc
   %%  Register a task with the task handler.
  +%%
  +%% @spec register_task(TaskName::task_name(), TaskImpl::task_impl(), Deps::deps(), Callable::bool(), Desc::desc()) -> ok
   %% @end
   %%--------------------------------------------------------------------
   register_task(TaskName, TaskImpl, Deps, Callable, Desc) when is_atom(TaskName), is_atom(TaskImpl) ->
       register_task(TaskName, TaskImpl, Deps, Callable, Desc, []).
   
   %%--------------------------------------------------------------------
  -%% @spec register_task(TaskName::atom(), TaskImpl::atom(), Deps::list(), Callable::bool(),
  -%%                     Desc::string(), Opt::string()) -> ok
  -%%
   %% @doc
   %%  Register a task with the task handler.
  +%%
  +%% @spec register_task(TaskName::task_name(), TaskImpl::task_impl(), Deps::deps(), Callable::bool(),
  +%%                     Desc::desc(), Opts::opts()) -> ok
  +%%
   %% @end
   %%--------------------------------------------------------------------
   register_task(TaskName, TaskImpl, Deps, Callable, Desc, Opts)
  
positive.code: %% Handling cast messages
  %% @end
  %%--------------------------------------------------------------------
  handle_cast({register_task, TaskDesc}, #state{tasks=Tasks}) ->
      TaskName = TaskDesc#task.name,
      {noreply, #state{tasks=register_task(TaskName, TaskDesc, Tasks)}};
  handle_cast({unregister_task, TaskName}, #state{tasks=Tasks}) ->
      {noreply, #state{tasks=unregister_task(TaskName, Tasks)}};
  handle_cast(shutdown, _) ->
      exit(normal).
  
  %%--------------------------------------------------------------------
  %% @spec handle_info(Info, State) -> {noreply, State} |
  %%                                       {noreply, State, Timeout} |
  %%                                       {stop, Reason, State}.
  %%
  %% @doc
  %% Handling all non call/cast messages
  %% @end
  %%--------------------------------------------------------------------
  handle_info(_Info, State) ->
      {noreply, State}.
  
  %%--------------------------------------------------------------------
  %% @spec terminate(Reason, State) -> void().
  %%
  %% @doc
  %% This function is called by a gen_server when it is about to
  %% terminate. It should be the opposite of Module:init/1 and do any necessary
  %% cleaning up. When it returns, the gen_server terminates with Reason.
  %% The return value is ignored.
  %% @end
  %%--------------------------------------------------------------------
  terminate(_Reason, _State) ->
      ok.
  
  %%--------------------------------------------------------------------
  %% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}.
  %%
  %% @doc
  %% Convert process state when code is changed
  %% @end
  %%--------------------------------------------------------------------
  code_change(_OldVsn, State, _Extra) ->
  
negative.code: -define(SERVER, ?MODULE).
  
  %% API
  -export([start_link/1, register_task/6, register_task/5, register_task/1,
           unregister_task/1, gen_task_chain/1, get_task_def/1,
           shutdown/0, get_task_defs/0, get_task_opts/1]).
  
  