Ulf Wiger 13 лет назад
Родитель
Сommit
b5c9cd27f6
12 измененных файлов с 331 добавлено и 500 удалено
  1. 8 18
      README.md
  2. 8 18
      doc/README.md
  3. 162 254
      doc/gproc.md
  4. 8 16
      doc/gproc_app.md
  5. 41 78
      doc/gproc_dist.md
  6. 7 13
      doc/gproc_info.md
  7. 9 16
      doc/gproc_init.md
  8. 28 53
      doc/gproc_lib.md
  9. 11 19
      doc/gproc_monitor.md
  10. 7 14
      doc/gproc_sup.md
  11. 23 1
      src/gproc.erl
  12. 19 0
      test/gproc_tests.erl

+ 8 - 18
README.md

@@ -1,10 +1,7 @@
 
 
-<h1>The gproc application</h1>
+#The gproc application#
 
-The gproc application
-=====================
-Extended process dictionary.
 
 __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)), Joseph Wayne Norton ([`norton@geminimobile.com`](mailto:norton@geminimobile.com)).
 
@@ -12,8 +9,7 @@ Extended process dictionary
 
 
 
-<h2>Introduction</h2>
-
+##Introduction##
 
 
 
@@ -43,8 +39,7 @@ Gproc is a process dictionary for Erlang, which provides a number of useful feat
 
 
 
-<h3>Use case: System inspection</h3>
-
+###Use case: System inspection##
 
 
 
@@ -57,8 +52,7 @@ browse key data in a running system.
 
 
 
-<h3>Use case: Pub/Sub patterns</h3>
-
+###Use case: Pub/Sub patterns##
 
 
 
@@ -78,8 +72,7 @@ notify(EventType, Msg) ->
 
 
 
-<h3>Use case: Environment handling</h3>
-
+###Use case: Environment handling##
 
 
 
@@ -96,8 +89,7 @@ See [`gproc:get_env/4`](http://github.com/esl/gproc/blob/master/doc/gproc.md#get
 
 
 
-<h2>Testing</h2>
-
+##Testing##
 
 
 
@@ -114,8 +106,7 @@ global gproc.
 
 
 
-<h2>Building Edoc</h2>
-
+##Building Edoc##
 
 
 
@@ -125,8 +116,7 @@ Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
 Freiburg 2007 ([Paper available here](http://github.com/esl/gproc/blob/master/doc/erlang07-wiger.pdf)).
 
 
-<h2 class="indextitle">Modules</h2>
-
+##Modules##
 
 
 <table width="100%" border="0" summary="list of modules">

+ 8 - 18
doc/README.md

@@ -1,10 +1,7 @@
 
 
-<h1>The gproc application</h1>
+#The gproc application#
 
-The gproc application
-=====================
-Extended process dictionary.
 
 __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)), Joseph Wayne Norton ([`norton@geminimobile.com`](mailto:norton@geminimobile.com)).
 
@@ -12,8 +9,7 @@ Extended process dictionary
 
 
 
-<h2>Introduction</h2>
-
+##Introduction##
 
 
 
@@ -43,8 +39,7 @@ Gproc is a process dictionary for Erlang, which provides a number of useful feat
 
 
 
-<h3>Use case: System inspection</h3>
-
+###Use case: System inspection##
 
 
 
@@ -57,8 +52,7 @@ browse key data in a running system.
 
 
 
-<h3>Use case: Pub/Sub patterns</h3>
-
+###Use case: Pub/Sub patterns##
 
 
 
@@ -78,8 +72,7 @@ notify(EventType, Msg) ->
 
 
 
-<h3>Use case: Environment handling</h3>
-
+###Use case: Environment handling##
 
 
 
@@ -96,8 +89,7 @@ See [`gproc:get_env/4`](gproc.md#get_env-4), [`gproc:get_set_env/4`](gproc.md#ge
 
 
 
-<h2>Testing</h2>
-
+##Testing##
 
 
 
@@ -114,8 +106,7 @@ global gproc.
 
 
 
-<h2>Building Edoc</h2>
-
+##Building Edoc##
 
 
 
@@ -125,8 +116,7 @@ Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
 Freiburg 2007 ([Paper available here](erlang07-wiger.pdf)).
 
 
-<h2 class="indextitle">Modules</h2>
-
+##Modules##
 
 
 <table width="100%" border="0" summary="list of modules">

+ 162 - 254
doc/gproc.md

@@ -1,9 +1,6 @@
-Module gproc
-============
 
 
-<h1>Module gproc</h1>
-
+#Module gproc#
 * [Description](#description)
 * [Data Types](#types)
 * [Function Index](#index)
@@ -17,10 +14,9 @@ This module implements an extended process registry.
 
 __Behaviours:__ [`gen_server`](gen_server.md).
 
-__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-consulting.com`](mailto:ulf.wiger@erlang-consulting.com)).
-
-<h2><a name="description">Description</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-consulting.com`](mailto:ulf.wiger@erlang-consulting.com)).<a name="description"></a>
 
+##Description##
 
 
 
@@ -30,8 +26,7 @@ For a detailed description, see
 
 
 
-<h2>Tuning Gproc performance</h2>
-
+##Tuning Gproc performance##
 
 
 
@@ -50,75 +45,67 @@ starting the `gproc` and `gproc_dist` servers. Default is `[]`. It is
 likely that `{priority, high | max}` and/or increasing `min_heap_size`
 will improve performance.
 
+<a name="types"></a>
 
-
-<h2><a name="types">Data Types</a></h2>
-
-
+##Data Types##
 
 
 
-<h3 class="typedecl"><a name="type-context">context()</a></h3>
 
+###<a name="type-context">context()</a>##
 
 
 
-<pre>context() = {<a href="#type-scope">scope()</a>, <a href="#type-type">type()</a>} | <a href="#type-type">type()</a></pre>
+<pre>context() = {[scope()](#type-scope), [type()](#type-type)} | [type()](#type-type)</pre>
 
 
 {'all','all'} is the default
 
 
 
-<h3 class="typedecl"><a name="type-headpat">headpat()</a></h3>
+###<a name="type-headpat">headpat()</a>##
 
 
 
+<pre>headpat() = {[keypat()](#type-keypat), [pidpat()](#type-pidpat), ValPat}</pre>
 
-<pre>headpat() = {<a href="#type-keypat">keypat()</a>, <a href="#type-pidpat">pidpat()</a>, ValPat}</pre>
 
 
+###<a name="type-key">key()</a>##
 
-<h3 class="typedecl"><a name="type-key">key()</a></h3>
 
 
+<pre>key() = {[type()](#type-type), [scope()](#type-scope), any()}</pre>
 
 
-<pre>key() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>, any()}</pre>
 
+###<a name="type-keypat">keypat()</a>##
 
 
-<h3 class="typedecl"><a name="type-keypat">keypat()</a></h3>
 
+<pre>keypat() = {[sel_type()](#type-sel_type) | [sel_var()](#type-sel_var), l | g | [sel_var()](#type-sel_var), any()}</pre>
 
 
 
-<pre>keypat() = {<a href="#type-sel_type">sel_type()</a> | <a href="#type-sel_var">sel_var()</a>, l | g | <a href="#type-sel_var">sel_var()</a>, any()}</pre>
+###<a name="type-pidpat">pidpat()</a>##
 
 
 
-<h3 class="typedecl"><a name="type-pidpat">pidpat()</a></h3>
-
-
-
-
-<pre>pidpat() = pid() | <a href="#type-sel_var">sel_var()</a></pre>
+<pre>pidpat() = pid() | [sel_var()](#type-sel_var)</pre>
 
 
 sel_var() = DollarVar | '_'.
 
 
-<h3 class="typedecl"><a name="type-reg_id">reg_id()</a></h3>
-
-
+###<a name="type-reg_id">reg_id()</a>##
 
 
-<pre>reg_id() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>, any()}</pre>
 
+<pre>reg_id() = {[type()](#type-type), [scope()](#type-scope), any()}</pre>
 
 
-<h3 class="typedecl"><a name="type-scope">scope()</a></h3>
 
+###<a name="type-scope">scope()</a>##
 
 
 
@@ -129,17 +116,15 @@ l = local registration; g = global registration
 
 
 
-<h3 class="typedecl"><a name="type-sel_pattern">sel_pattern()</a></h3>
+###<a name="type-sel_pattern">sel_pattern()</a>##
 
 
 
+<pre>sel_pattern() = [{[headpat()](#type-headpat), Guards, Prod}]</pre>
 
-<pre>sel_pattern() = [{<a href="#type-headpat">headpat()</a>, Guards, Prod}]</pre>
 
 
-
-<h3 class="typedecl"><a name="type-sel_scope">sel_scope()</a></h3>
-
+###<a name="type-sel_scope">sel_scope()</a>##
 
 
 
@@ -147,17 +132,15 @@ l = local registration; g = global registration
 
 
 
-<h3 class="typedecl"><a name="type-sel_type">sel_type()</a></h3>
-
+###<a name="type-sel_type">sel_type()</a>##
 
 
 
-<pre>sel_type() = <a href="#type-type">type()</a> | names | props | counters | aggr_counters</pre>
+<pre>sel_type() = [type()](#type-type) | names | props | counters | aggr_counters</pre>
 
 
 
-<h3 class="typedecl"><a name="type-type">type()</a></h3>
-
+###<a name="type-type">type()</a>##
 
 
 
@@ -168,16 +151,14 @@ n = name; p = property; c = counter;
 a = aggregate_counter
 
 
-<h3 class="typedecl"><a name="type-unique_id">unique_id()</a></h3>
-
-
+###<a name="type-unique_id">unique_id()</a>##
 
 
-<pre>unique_id() = {n | a, <a href="#type-scope">scope()</a>, any()}</pre>
 
+<pre>unique_id() = {n | a, [scope()](#type-scope), any()}</pre>
+<a name="index"></a>
 
-<h2><a name="index">Function Index</a></h2>
-
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#add_global_aggr_counter-1">add_global_aggr_counter/1</a></td><td>Registers a global (unique) aggregated counter.</td></tr><tr><td valign="top"><a href="#add_global_counter-2">add_global_counter/2</a></td><td>Registers a global (non-unique) counter.</td></tr><tr><td valign="top"><a href="#add_global_name-1">add_global_name/1</a></td><td>Registers a global (unique) name.</td></tr><tr><td valign="top"><a href="#add_global_property-2">add_global_property/2</a></td><td>Registers a global (non-unique) property.</td></tr><tr><td valign="top"><a href="#add_local_aggr_counter-1">add_local_aggr_counter/1</a></td><td>Registers a local (unique) aggregated counter.</td></tr><tr><td valign="top"><a href="#add_local_counter-2">add_local_counter/2</a></td><td>Registers a local (non-unique) counter.</td></tr><tr><td valign="top"><a href="#add_local_name-1">add_local_name/1</a></td><td>Registers a local (unique) name.</td></tr><tr><td valign="top"><a href="#add_local_property-2">add_local_property/2</a></td><td>Registers a local (non-unique) property.</td></tr><tr><td valign="top"><a href="#add_shared_local_counter-2">add_shared_local_counter/2</a></td><td>Registers a local shared (unique) counter.</td></tr><tr><td valign="top"><a href="#audit_process-1">audit_process/1</a></td><td></td></tr><tr><td valign="top"><a href="#await-1">await/1</a></td><td>Equivalent to <a href="#await-2"><tt>await(Key, infinity)</tt></a>.</td></tr><tr><td valign="top"><a href="#await-2">await/2</a></td><td>Wait for a local name to be registered.</td></tr><tr><td valign="top"><a href="#cancel_wait-2">cancel_wait/2</a></td><td>Cancels a previous call to nb_wait/1.</td></tr><tr><td valign="top"><a href="#cancel_wait_or_monitor-1">cancel_wait_or_monitor/1</a></td><td></td></tr><tr><td valign="top"><a href="#default-1">default/1</a></td><td></td></tr><tr><td valign="top"><a href="#demonitor-2">demonitor/2</a></td><td>Remove a monitor on a registered name
@@ -189,15 +170,13 @@ a unique name registered via gproc.</td></tr><tr><td valign="top"><a href="#mreg
 see http://www.erlang.org/doc/man/ets.html#select-1.</td></tr><tr><td valign="top"><a href="#select-2">select/2</a></td><td>Perform a select operation on the process registry.</td></tr><tr><td valign="top"><a href="#select-3">select/3</a></td><td>Like <a href="#select-2"><code>select/2</code></a> but returns Limit objects at a time.</td></tr><tr><td valign="top"><a href="#select_count-1">select_count/1</a></td><td>Equivalent to <a href="#select_count-2"><tt>select_count(all, Pat)</tt></a>.</td></tr><tr><td valign="top"><a href="#select_count-2">select_count/2</a></td><td>Perform a select_count operation on the process registry.</td></tr><tr><td valign="top"><a href="#send-2">send/2</a></td><td>Sends a message to the process, or processes, corresponding to Key.</td></tr><tr><td valign="top"><a href="#set_env-5">set_env/5</a></td><td>Updates the cached value as well as underlying environment.</td></tr><tr><td valign="top"><a href="#set_value-2">set_value/2</a></td><td>Sets the value of the registeration entry given by Key.</td></tr><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>Starts the gproc server.</td></tr><tr><td valign="top"><a href="#table-0">table/0</a></td><td>Equivalent to <a href="#table-1"><tt>table({all, all})</tt></a>.</td></tr><tr><td valign="top"><a href="#table-1">table/1</a></td><td>Equivalent to <a href="#table-2"><tt>table(Context, [])</tt></a>.</td></tr><tr><td valign="top"><a href="#table-2">table/2</a></td><td>QLC table generator for the gproc registry.</td></tr><tr><td valign="top"><a href="#unreg-1">unreg/1</a></td><td>Unregister a name or property.</td></tr><tr><td valign="top"><a href="#unreg_shared-1">unreg_shared/1</a></td><td>Unregister a shared resource.</td></tr><tr><td valign="top"><a href="#unregister_name-1">unregister_name/1</a></td><td>Equivalent to <tt>unreg / 1</tt>.</td></tr><tr><td valign="top"><a href="#update_counter-2">update_counter/2</a></td><td>Updates the counter registered as Key for the current process.</td></tr><tr><td valign="top"><a href="#update_shared_counter-2">update_shared_counter/2</a></td><td></td></tr><tr><td valign="top"><a href="#where-1">where/1</a></td><td>Returns the pid registered as Key.</td></tr><tr><td valign="top"><a href="#whereis_name-1">whereis_name/1</a></td><td>Equivalent to <tt>where / 1</tt>.</td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="add_global_aggr_counter-1"></a>
 
-<h3>add_global_aggr_counter/1</h3>
-
+###add_global_aggr_counter/1##
 
 
 
@@ -210,8 +189,7 @@ Equivalent to [`reg({a, g, Name})`](#reg-1).
 
 Registers a global (unique) aggregated counter.<a name="add_global_counter-2"></a>
 
-<h3>add_global_counter/2</h3>
-
+###add_global_counter/2##
 
 
 
@@ -222,8 +200,7 @@ Registers a global (unique) aggregated counter.<a name="add_global_counter-2"></
 
 Registers a global (non-unique) counter. @equiv reg({c,g,Name},Value)<a name="add_global_name-1"></a>
 
-<h3>add_global_name/1</h3>
-
+###add_global_name/1##
 
 
 
@@ -234,8 +211,7 @@ Registers a global (non-unique) counter. @equiv reg({c,g,Name},Value)<a name="ad
 
 Registers a global (unique) name. @equiv reg({n,g,Name})<a name="add_global_property-2"></a>
 
-<h3>add_global_property/2</h3>
-
+###add_global_property/2##
 
 
 
@@ -246,8 +222,7 @@ Registers a global (unique) name. @equiv reg({n,g,Name})<a name="add_global_prop
 
 Registers a global (non-unique) property. @equiv reg({p,g,Name},Value)<a name="add_local_aggr_counter-1"></a>
 
-<h3>add_local_aggr_counter/1</h3>
-
+###add_local_aggr_counter/1##
 
 
 
@@ -260,8 +235,7 @@ Equivalent to [`reg({a, l, Name})`](#reg-1).
 
 Registers a local (unique) aggregated counter.<a name="add_local_counter-2"></a>
 
-<h3>add_local_counter/2</h3>
-
+###add_local_counter/2##
 
 
 
@@ -272,8 +246,7 @@ Registers a local (unique) aggregated counter.<a name="add_local_counter-2"></a>
 
 Registers a local (non-unique) counter. @equiv reg({c,l,Name},Value)<a name="add_local_name-1"></a>
 
-<h3>add_local_name/1</h3>
-
+###add_local_name/1##
 
 
 
@@ -284,8 +257,7 @@ Registers a local (non-unique) counter. @equiv reg({c,l,Name},Value)<a name="add
 
 Registers a local (unique) name. @equiv reg({n,l,Name})<a name="add_local_property-2"></a>
 
-<h3>add_local_property/2</h3>
-
+###add_local_property/2##
 
 
 
@@ -296,8 +268,7 @@ Registers a local (unique) name. @equiv reg({n,l,Name})<a name="add_local_proper
 
 Registers a local (non-unique) property. @equiv reg({p,l,Name},Value)<a name="add_shared_local_counter-2"></a>
 
-<h3>add_shared_local_counter/2</h3>
-
+###add_shared_local_counter/2##
 
 
 
@@ -310,25 +281,23 @@ Equivalent to [`reg_shared({c, l, Name}, Value)`](#reg_shared-2).
 
 Registers a local shared (unique) counter.<a name="audit_process-1"></a>
 
-<h3>audit_process/1</h3>
+###audit_process/1##
 
 
 
 
-
-<pre>audit_process(Pid::pid()) -> ok</pre>
+<pre>audit_process(Pid::pid()) -&gt; ok</pre>
 <br></br>
 
 
 <a name="await-1"></a>
 
-<h3>await/1</h3>
-
+###await/1##
 
 
 
 
-<pre>await(Key::<a href="#type-key">key()</a>) -> {pid(), Value}</pre>
+<pre>await(Key::[key()](#type-key)) -&gt; {pid(), Value}</pre>
 <br></br>
 
 
@@ -336,13 +305,12 @@ Registers a local shared (unique) counter.<a name="audit_process-1"></a>
 
 Equivalent to [`await(Key, infinity)`](#await-2).<a name="await-2"></a>
 
-<h3>await/2</h3>
-
+###await/2##
 
 
 
 
-<pre>await(Key::<a href="#type-key">key()</a>, Timeout) -> {pid(), Value}</pre>
+<pre>await(Key::[key()](#type-key), Timeout) -&gt; {pid(), Value}</pre>
 <ul class="definitions"><li><pre>Timeout = integer() | infinity</pre></li></ul>
 
 
@@ -355,13 +323,12 @@ is already registered. This way, the cost of the operation will be
 roughly the same as of where/1 in the case where the name is already
 registered (the difference: await/2 also returns the value).<a name="cancel_wait-2"></a>
 
-<h3>cancel_wait/2</h3>
+###cancel_wait/2##
 
 
 
 
-
-<pre>cancel_wait(Key::<a href="#type-key">key()</a>, Ref) -> ok</pre>
+<pre>cancel_wait(Key::[key()](#type-key), Ref) -&gt; ok</pre>
 <ul class="definitions"><li><pre>Ref = all | reference()</pre></li></ul>
 
 
@@ -373,8 +340,7 @@ Cancels a previous call to nb_wait/1
 If `Ref = all`, all wait requests on `Key` from the calling process
 are canceled.<a name="cancel_wait_or_monitor-1"></a>
 
-<h3>cancel_wait_or_monitor/1</h3>
-
+###cancel_wait_or_monitor/1##
 
 
 
@@ -383,8 +349,7 @@ are canceled.<a name="cancel_wait_or_monitor-1"></a>
 
 <a name="default-1"></a>
 
-<h3>default/1</h3>
-
+###default/1##
 
 
 
@@ -393,13 +358,12 @@ are canceled.<a name="cancel_wait_or_monitor-1"></a>
 
 <a name="demonitor-2"></a>
 
-<h3>demonitor/2</h3>
+###demonitor/2##
 
 
 
 
-
-<pre>demonitor(Key::<a href="#type-key">key()</a>, Ref::reference()) -> ok</pre>
+<pre>demonitor(Key::[key()](#type-key), Ref::reference()) -&gt; ok</pre>
 <br></br>
 
 
@@ -409,13 +373,12 @@ Remove a monitor on a registered name
 This function is the reverse of monitor/1. It removes a monitor previously
 set on a unique name. This function always succeeds given legal input.<a name="first-1"></a>
 
-<h3>first/1</h3>
-
+###first/1##
 
 
 
 
-<pre>first(Context::<a href="#type-context">context()</a>) -> <a href="#type-key">key()</a> | '$end_of_table'</pre>
+<pre>first(Context::[context()](#type-context)) -&gt; [key()](#type-key) | '$end_of_table'</pre>
 <br></br>
 
 
@@ -428,13 +391,12 @@ Behaves as ets:first(Tab) for a given type of registration object.
 See [`http://www.erlang.org/doc/man/ets.html#first-1`](http://www.erlang.org/doc/man/ets.html#first-1).
 The registry behaves as an ordered_set table.<a name="get_env-3"></a>
 
-<h3>get_env/3</h3>
-
+###get_env/3##
 
 
 
 
-<pre>get_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom()) -> term()</pre>
+<pre>get_env(Scope::[scope()](#type-scope), App::atom(), Key::atom()) -&gt; term()</pre>
 <br></br>
 
 
@@ -442,14 +404,13 @@ The registry behaves as an ordered_set table.<a name="get_env-3"></a>
 
 Equivalent to [`get_env(Scope, App, Key, [app_env])`](#get_env-4).<a name="get_env-4"></a>
 
-<h3>get_env/4</h3>
+###get_env/4##
 
 
 
 
-
-<pre>get_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Strategy) -> term()</pre>
-<ul class="definitions"><li><pre>Strategy = [Alternative]</pre></li><li><pre>Alternative = app_env | os_env | inherit | {inherit, pid()} | {inherit, <a href="#type-unique_id">unique_id()</a>} | init_arg | {mnesia, ActivityType, Oid, Pos} | {default, term()} | error</pre></li></ul>
+<pre>get_env(Scope::[scope()](#type-scope), App::atom(), Key::atom(), Strategy) -&gt; term()</pre>
+<ul class="definitions"><li><pre>Strategy = [Alternative]</pre></li><li><pre>Alternative = app_env | os_env | inherit | {inherit, pid()} | {inherit, &lt;a href="#type-unique_id"&gt;unique_id()&lt;/a&gt;} | init_arg | {mnesia, ActivityType, Oid, Pos} | {default, term()} | error</pre></li></ul>
 
 
 
@@ -503,13 +464,12 @@ cached. Alternatively, it can be used to assert that a value is either cached
 or at least defined somewhere,
 e.g. `get_env(l, mnesia, dir, [app_env, error])`.<a name="get_set_env-3"></a>
 
-<h3>get_set_env/3</h3>
-
+###get_set_env/3##
 
 
 
 
-<pre>get_set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom()) -> term()</pre>
+<pre>get_set_env(Scope::[scope()](#type-scope), App::atom(), Key::atom()) -&gt; term()</pre>
 <br></br>
 
 
@@ -517,13 +477,12 @@ e.g. `get_env(l, mnesia, dir, [app_env, error])`.<a name="get_set_env-3"></a>
 
 Equivalent to [`get_set_env(Scope, App, Key, [app_env])`](#get_set_env-4).<a name="get_set_env-4"></a>
 
-<h3>get_set_env/4</h3>
-
+###get_set_env/4##
 
 
 
 
-<pre>get_set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Strategy) -> Value</pre>
+<pre>get_set_env(Scope::[scope()](#type-scope), App::atom(), Key::atom(), Strategy) -&gt; Value</pre>
 <br></br>
 
 
@@ -540,13 +499,12 @@ is `undefined`.
 
 __See also:__ [get_env/4](#get_env-4).<a name="get_value-1"></a>
 
-<h3>get_value/1</h3>
+###get_value/1##
 
 
 
 
-
-<pre>get_value(Key) -> Value</pre>
+<pre>get_value(Key) -&gt; Value</pre>
 <br></br>
 
 
@@ -558,13 +516,12 @@ Reads the value stored with a key registered to the current process.
 
 If no such key is registered to the current process, this function exits.<a name="get_value-2"></a>
 
-<h3>get_value/2</h3>
-
+###get_value/2##
 
 
 
 
-<pre>get_value(Key, Pid) -> Value</pre>
+<pre>get_value(Key, Pid) -&gt; Value</pre>
 <br></br>
 
 
@@ -577,13 +534,12 @@ Reads the value stored with a key registered to the process Pid.
 If `Pid == shared`, the value of a shared key (see [`reg_shared/1`](#reg_shared-1))
 will be read.<a name="give_away-2"></a>
 
-<h3>give_away/2</h3>
-
+###give_away/2##
 
 
 
 
-<pre>give_away(From::<a href="#type-key">key()</a>, To::pid() | <a href="#type-key">key()</a>) -> undefined | pid()</pre>
+<pre>give_away(From::[key()](#type-key), To::pid() | [key()](#type-key)) -&gt; undefined | pid()</pre>
 <br></br>
 
 
@@ -613,13 +569,12 @@ will have no effect.
 Fails with `badarg` if the calling process does not have a `From` key
 registered.<a name="goodbye-0"></a>
 
-<h3>goodbye/0</h3>
+###goodbye/0##
 
 
 
 
-
-<pre>goodbye() -> ok</pre>
+<pre>goodbye() -&gt; ok</pre>
 <br></br>
 
 
@@ -633,13 +588,12 @@ to forget about the calling process.
 This function is more efficient than letting gproc perform these
 cleanup operations.<a name="i-0"></a>
 
-<h3>i/0</h3>
-
+###i/0##
 
 
 
 
-<pre>i() -> ok</pre>
+<pre>i() -&gt; ok</pre>
 <br></br>
 
 
@@ -648,13 +602,12 @@ cleanup operations.<a name="i-0"></a>
 Similar to the built-in shell command `i()` but inserts information
 about names and properties registered in Gproc, where applicable.<a name="info-1"></a>
 
-<h3>info/1</h3>
+###info/1##
 
 
 
 
-
-<pre>info(Pid::pid()) -> ProcessInfo</pre>
+<pre>info(Pid::pid()) -&gt; ProcessInfo</pre>
 <ul class="definitions"><li><pre>ProcessInfo = [{gproc, [{Key, Value}]} | ProcessInfo]</pre></li></ul>
 
 
@@ -667,13 +620,12 @@ Returns the same information as process_info(Pid), but with the
 addition of a `gproc` information item, containing the `{Key,Value}`
 pairs registered to the process.<a name="info-2"></a>
 
-<h3>info/2</h3>
-
+###info/2##
 
 
 
 
-<pre>info(Pid::pid(), Item::atom()) -> {Item, Info}</pre>
+<pre>info(Pid::pid(), Item::atom()) -&gt; {Item, Info}</pre>
 <br></br>
 
 
@@ -687,13 +639,12 @@ For `Item = gproc`, this function returns a list of `{Key, Value}` pairs
 registered to the process Pid. For other values of Item, it returns the
 same as [`http://www.erlang.org/doc/man/erlang.html#process_info-2`](http://www.erlang.org/doc/man/erlang.html#process_info-2).<a name="last-1"></a>
 
-<h3>last/1</h3>
-
+###last/1##
 
 
 
 
-<pre>last(Context::<a href="#type-context">context()</a>) -> <a href="#type-key">key()</a> | '$end_of_table'</pre>
+<pre>last(Context::[context()](#type-context)) -&gt; [key()](#type-key) | '$end_of_table'</pre>
 <br></br>
 
 
@@ -706,13 +657,12 @@ Behaves as ets:last(Tab) for a given type of registration object.
 See [`http://www.erlang.org/doc/man/ets.html#last-1`](http://www.erlang.org/doc/man/ets.html#last-1).
 The registry behaves as an ordered_set table.<a name="lookup_global_aggr_counter-1"></a>
 
-<h3>lookup_global_aggr_counter/1</h3>
+###lookup_global_aggr_counter/1##
 
 
 
 
-
-<pre>lookup_global_aggr_counter(Name::any()) -> integer()</pre>
+<pre>lookup_global_aggr_counter(Name::any()) -&gt; integer()</pre>
 <br></br>
 
 
@@ -723,13 +673,12 @@ Equivalent to [`where({a, g, Name})`](#where-1).
 Lookup a global (unique) aggregated counter and returns its value.
 Fails if there is no such object.<a name="lookup_global_counters-1"></a>
 
-<h3>lookup_global_counters/1</h3>
-
+###lookup_global_counters/1##
 
 
 
 
-<pre>lookup_global_counters(Counter::any()) -> [{pid(), Value::integer()}]</pre>
+<pre>lookup_global_counters(Counter::any()) -&gt; [{pid(), Value::integer()}]</pre>
 <br></br>
 
 
@@ -740,13 +689,12 @@ Equivalent to [`lookup_values({c, g, Counter})`](#lookup_values-1).
 Look up all global (non-unique) instances of a given Counter.
 Returns a list of {Pid, Value} tuples for all matching objects.<a name="lookup_global_name-1"></a>
 
-<h3>lookup_global_name/1</h3>
-
+###lookup_global_name/1##
 
 
 
 
-<pre>lookup_global_name(Name::any()) -> pid()</pre>
+<pre>lookup_global_name(Name::any()) -&gt; pid()</pre>
 <br></br>
 
 
@@ -756,13 +704,12 @@ Equivalent to [`where({n, g, Name})`](#where-1).
 
 Lookup a global unique name. Fails if there is no such name.<a name="lookup_global_properties-1"></a>
 
-<h3>lookup_global_properties/1</h3>
+###lookup_global_properties/1##
 
 
 
 
-
-<pre>lookup_global_properties(Property::any()) -> [{pid(), Value}]</pre>
+<pre>lookup_global_properties(Property::any()) -&gt; [{pid(), Value}]</pre>
 <br></br>
 
 
@@ -773,13 +720,12 @@ Equivalent to [`lookup_values({p, g, Property})`](#lookup_values-1).
 Look up all global (non-unique) instances of a given Property.
 Returns a list of {Pid, Value} tuples for all matching objects.<a name="lookup_local_aggr_counter-1"></a>
 
-<h3>lookup_local_aggr_counter/1</h3>
-
+###lookup_local_aggr_counter/1##
 
 
 
 
-<pre>lookup_local_aggr_counter(Name::any()) -> integer()</pre>
+<pre>lookup_local_aggr_counter(Name::any()) -&gt; integer()</pre>
 <br></br>
 
 
@@ -790,13 +736,12 @@ Equivalent to [`where({a, l, Name})`](#where-1).
 Lookup a local (unique) aggregated counter and returns its value.
 Fails if there is no such object.<a name="lookup_local_counters-1"></a>
 
-<h3>lookup_local_counters/1</h3>
-
+###lookup_local_counters/1##
 
 
 
 
-<pre>lookup_local_counters(Counter::any()) -> [{pid(), Value::integer()}]</pre>
+<pre>lookup_local_counters(Counter::any()) -&gt; [{pid(), Value::integer()}]</pre>
 <br></br>
 
 
@@ -807,13 +752,12 @@ Equivalent to [`lookup_values({c, l, Counter})`](#lookup_values-1).
 Look up all local (non-unique) instances of a given Counter.
 Returns a list of {Pid, Value} tuples for all matching objects.<a name="lookup_local_name-1"></a>
 
-<h3>lookup_local_name/1</h3>
+###lookup_local_name/1##
 
 
 
 
-
-<pre>lookup_local_name(Name::any()) -> pid()</pre>
+<pre>lookup_local_name(Name::any()) -&gt; pid()</pre>
 <br></br>
 
 
@@ -823,13 +767,12 @@ Equivalent to [`where({n, l, Name})`](#where-1).
 
 Lookup a local unique name. Fails if there is no such name.<a name="lookup_local_properties-1"></a>
 
-<h3>lookup_local_properties/1</h3>
-
+###lookup_local_properties/1##
 
 
 
 
-<pre>lookup_local_properties(Property::any()) -> [{pid(), Value}]</pre>
+<pre>lookup_local_properties(Property::any()) -&gt; [{pid(), Value}]</pre>
 <br></br>
 
 
@@ -840,13 +783,12 @@ Equivalent to [`lookup_values({p, l, Property})`](#lookup_values-1).
 Look up all local (non-unique) instances of a given Property.
 Returns a list of {Pid, Value} tuples for all matching objects.<a name="lookup_pid-1"></a>
 
-<h3>lookup_pid/1</h3>
-
+###lookup_pid/1##
 
 
 
 
-<pre>lookup_pid(Key) -> Pid</pre>
+<pre>lookup_pid(Key) -&gt; Pid</pre>
 <br></br>
 
 
@@ -855,13 +797,12 @@ Returns a list of {Pid, Value} tuples for all matching objects.<a name="lookup_p
 Lookup the Pid stored with a key.
 <a name="lookup_pids-1"></a>
 
-<h3>lookup_pids/1</h3>
+###lookup_pids/1##
 
 
 
 
-
-<pre>lookup_pids(Key::<a href="#type-key">key()</a>) -> [pid()]</pre>
+<pre>lookup_pids(Key::[key()](#type-key)) -&gt; [pid()]</pre>
 <br></br>
 
 
@@ -875,13 +816,12 @@ If the type of registration entry is either name or aggregated counter,
 this function will return either an empty list, or a list of one pid.
 For non-unique types, the return value can be a list of any length.<a name="lookup_value-1"></a>
 
-<h3>lookup_value/1</h3>
-
+###lookup_value/1##
 
 
 
 
-<pre>lookup_value(Key) -> Value</pre>
+<pre>lookup_value(Key) -&gt; Value</pre>
 <br></br>
 
 
@@ -890,13 +830,12 @@ For non-unique types, the return value can be a list of any length.<a name="look
 Lookup the value stored with a key.
 <a name="lookup_values-1"></a>
 
-<h3>lookup_values/1</h3>
-
+###lookup_values/1##
 
 
 
 
-<pre>lookup_values(Key::<a href="#type-key">key()</a>) -> [{pid(), Value}]</pre>
+<pre>lookup_values(Key::[key()](#type-key)) -&gt; [{pid(), Value}]</pre>
 <br></br>
 
 
@@ -910,13 +849,12 @@ Key refer to any type of registry object. If it refers to a unique
 object, the list will be of length 0 or 1. If it refers to a non-unique
 object, the return value can be a list of any length.<a name="monitor-1"></a>
 
-<h3>monitor/1</h3>
+###monitor/1##
 
 
 
 
-
-<pre>monitor(Key::<a href="#type-key">key()</a>) -> reference()</pre>
+<pre>monitor(Key::[key()](#type-key)) -&gt; reference()</pre>
 <br></br>
 
 
@@ -932,13 +870,12 @@ the registered process dies.
 
 If the name is not yet registered, the same message is sent immediately.<a name="mreg-3"></a>
 
-<h3>mreg/3</h3>
-
+###mreg/3##
 
 
 
 
-<pre>mreg(T::<a href="#type-type">type()</a>, X2::<a href="#type-scope">scope()</a>, KVL::[{Key::any(), Value::any()}]) -> true</pre>
+<pre>mreg(T::[type()](#type-type), X2::[scope()](#type-scope), KVL::[{Key::any(), Value::any()}]) -&gt; true</pre>
 <br></br>
 
 
@@ -952,13 +889,12 @@ This function is more efficient than calling [`reg/2`](#reg-2) repeatedly.
 It is also atomic in regard to unique names; either all names are registered
 or none are.<a name="munreg-3"></a>
 
-<h3>munreg/3</h3>
-
+###munreg/3##
 
 
 
 
-<pre>munreg(T::<a href="#type-type">type()</a>, X2::<a href="#type-scope">scope()</a>, L::[Key::any()]) -> true</pre>
+<pre>munreg(T::[type()](#type-type), X2::[scope()](#type-scope), L::[Key::any()]) -&gt; true</pre>
 <br></br>
 
 
@@ -971,13 +907,12 @@ Unregister multiple Key items of a given type and scope.
 This function is usually more efficient than calling [`unreg/1`](#unreg-1)
 repeatedly.<a name="nb_wait-1"></a>
 
-<h3>nb_wait/1</h3>
+###nb_wait/1##
 
 
 
 
-
-<pre>nb_wait(Key::<a href="#type-key">key()</a>) -> Ref</pre>
+<pre>nb_wait(Key::[key()](#type-key)) -&gt; Ref</pre>
 <br></br>
 
 
@@ -987,13 +922,12 @@ Wait for a local name to be registered.
 The caller can expect to receive a message,
 {gproc, Ref, registered, {Key, Pid, Value}}, once the name is registered.<a name="next-2"></a>
 
-<h3>next/2</h3>
-
+###next/2##
 
 
 
 
-<pre>next(Context::<a href="#type-context">context()</a>, Key::<a href="#type-key">key()</a>) -> <a href="#type-key">key()</a> | '$end_of_table'</pre>
+<pre>next(Context::[context()](#type-context), Key::[key()](#type-key)) -&gt; [key()](#type-key) | '$end_of_table'</pre>
 <br></br>
 
 
@@ -1006,13 +940,12 @@ Behaves as ets:next(Tab,Key) for a given type of registration object.
 See [`http://www.erlang.org/doc/man/ets.html#next-2`](http://www.erlang.org/doc/man/ets.html#next-2).
 The registry behaves as an ordered_set table.<a name="prev-2"></a>
 
-<h3>prev/2</h3>
-
+###prev/2##
 
 
 
 
-<pre>prev(Context::<a href="#type-context">context()</a>, Key::<a href="#type-key">key()</a>) -> <a href="#type-key">key()</a> | '$end_of_table'</pre>
+<pre>prev(Context::[context()](#type-context), Key::[key()](#type-key)) -&gt; [key()](#type-key) | '$end_of_table'</pre>
 <br></br>
 
 
@@ -1025,13 +958,12 @@ Behaves as ets:prev(Tab,Key) for a given type of registration object.
 See [`http://www.erlang.org/doc/man/ets.html#prev-2`](http://www.erlang.org/doc/man/ets.html#prev-2).
 The registry behaves as an ordered_set table.<a name="reg-1"></a>
 
-<h3>reg/1</h3>
+###reg/1##
 
 
 
 
-
-<pre>reg(Key::<a href="#type-key">key()</a>) -> true</pre>
+<pre>reg(Key::[key()](#type-key)) -&gt; true</pre>
 <br></br>
 
 
@@ -1039,13 +971,12 @@ The registry behaves as an ordered_set table.<a name="reg-1"></a>
 
 Equivalent to [`reg(Key, default(Key))`](#reg-2).<a name="reg-2"></a>
 
-<h3>reg/2</h3>
-
+###reg/2##
 
 
 
 
-<pre>reg(Key::<a href="#type-key">key()</a>, Value) -> true</pre>
+<pre>reg(Key::[key()](#type-key), Value) -&gt; true</pre>
 <br></br>
 
 
@@ -1057,13 +988,12 @@ Register a name or property for the current process
 
 <a name="reg_shared-1"></a>
 
-<h3>reg_shared/1</h3>
+###reg_shared/1##
 
 
 
 
-
-<pre>reg_shared(Key::<a href="#type-key">key()</a>) -> true</pre>
+<pre>reg_shared(Key::[key()](#type-key)) -&gt; true</pre>
 <br></br>
 
 
@@ -1076,13 +1006,12 @@ Register a resource, but don't tie it to a particular process.
 `reg_shared({c,l,C}) -> reg_shared({c,l,C}, 0).`
 `reg_shared({a,l,A}) -> reg_shared({a,l,A}, undefined).`<a name="reg_shared-2"></a>
 
-<h3>reg_shared/2</h3>
-
+###reg_shared/2##
 
 
 
 
-<pre>reg_shared(Key::<a href="#type-key">key()</a>, Value) -> true</pre>
+<pre>reg_shared(Key::[key()](#type-key), Value) -&gt; true</pre>
 <br></br>
 
 
@@ -1104,13 +1033,12 @@ increment the shared counter `myCounter` with 1, provided it exists.
 A shared aggregated counter will track updates in exactly the same way as
 an aggregated counter which is owned by a process.<a name="register_name-2"></a>
 
-<h3>register_name/2</h3>
-
+###register_name/2##
 
 
 
 
-<pre>register_name(Name::<a href="#type-key">key()</a>, Pid::pid()) -> yes | no</pre>
+<pre>register_name(Name::[key()](#type-key), Pid::pid()) -&gt; yes | no</pre>
 <br></br>
 
 
@@ -1118,13 +1046,12 @@ an aggregated counter which is owned by a process.<a name="register_name-2"></a>
 
 Behaviour support callback<a name="reset_counter-1"></a>
 
-<h3>reset_counter/1</h3>
+###reset_counter/1##
 
 
 
 
-
-<pre>reset_counter(Key) -> {ValueBefore, ValueAfter}</pre>
+<pre>reset_counter(Key) -&gt; {ValueBefore, ValueAfter}</pre>
 <ul class="definitions"><li><pre>Key = {c, Scope, Name}</pre></li><li><pre>Scope = l | g</pre></li><li><pre>ValueBefore = integer()</pre></li><li><pre>ValueAfter = integer()</pre></li></ul>
 
 
@@ -1138,13 +1065,12 @@ initial value. The reset operation is done using [`update_counter/2`](#update_co
 which allows for concurrent calls to [`update_counter/2`](#update_counter-2) without losing
 updates. Aggregated counters are updated accordingly.<a name="select-1"></a>
 
-<h3>select/1</h3>
-
+###select/1##
 
 
 
 
-<pre>select(Continuation::term()) -> {[Match], Continuation} | '$end_of_table'</pre>
+<pre>select(Continuation::term()) -&gt; {[Match], Continuation} | '$end_of_table'</pre>
 <br></br>
 
 
@@ -1153,13 +1079,12 @@ updates. Aggregated counters are updated accordingly.<a name="select-1"></a>
 
 see http://www.erlang.org/doc/man/ets.html#select-1<a name="select-2"></a>
 
-<h3>select/2</h3>
-
+###select/2##
 
 
 
 
-<pre>select(Context::<a href="#type-context">context()</a>, Pat::<a href="#type-sel_pattern">sel_pattern()</a>) -> [{Key, Pid, Value}]</pre>
+<pre>select(Context::[context()](#type-context), Pat::[sel_pattern()](#type-sel_pattern)) -&gt; [{Key, Pid, Value}]</pre>
 <br></br>
 
 
@@ -1172,13 +1097,12 @@ Perform a select operation on the process registry.
 The physical representation in the registry may differ from the above,
 but the select patterns are transformed appropriately.<a name="select-3"></a>
 
-<h3>select/3</h3>
+###select/3##
 
 
 
 
-
-<pre>select(Context::<a href="#type-context">context()</a>, Pat::<a href="#type-sel_patten">sel_patten()</a>, Limit::integer()) -> {[Match], Continuation} | '$end_of_table'</pre>
+<pre>select(Context::[context()](#type-context), Pat::[sel_patten()](#type-sel_patten), Limit::integer()) -&gt; {[Match], Continuation} | '$end_of_table'</pre>
 <br></br>
 
 
@@ -1190,13 +1114,12 @@ Like [`select/2`](#select-2) but returns Limit objects at a time.
 
 See [`http://www.erlang.org/doc/man/ets.html#select-3`](http://www.erlang.org/doc/man/ets.html#select-3).<a name="select_count-1"></a>
 
-<h3>select_count/1</h3>
-
+###select_count/1##
 
 
 
 
-<pre>select_count(Pat::<a href="#type-select_pattern">select_pattern()</a>) -> [<a href="#type-sel_object">sel_object()</a>]</pre>
+<pre>select_count(Pat::[select_pattern()](#type-select_pattern)) -&gt; [[sel_object()](#type-sel_object)]</pre>
 <br></br>
 
 
@@ -1204,13 +1127,12 @@ See [`http://www.erlang.org/doc/man/ets.html#select-3`](http://www.erlang.org/do
 
 Equivalent to [`select_count(all, Pat)`](#select_count-2).<a name="select_count-2"></a>
 
-<h3>select_count/2</h3>
-
+###select_count/2##
 
 
 
 
-<pre>select_count(Context::<a href="#type-context">context()</a>, Pat::<a href="#type-sel_pattern">sel_pattern()</a>) -> [{Key, Pid, Value}]</pre>
+<pre>select_count(Context::[context()](#type-context), Pat::[sel_pattern()](#type-sel_pattern)) -&gt; [{Key, Pid, Value}]</pre>
 <br></br>
 
 
@@ -1223,13 +1145,12 @@ Perform a select_count operation on the process registry.
 The physical representation in the registry may differ from the above,
 but the select patterns are transformed appropriately.<a name="send-2"></a>
 
-<h3>send/2</h3>
+###send/2##
 
 
 
 
-
-<pre>send(Key::<a href="#type-key">key()</a>, Msg::any()) -> Msg</pre>
+<pre>send(Key::[key()](#type-key), Msg::any()) -&gt; Msg</pre>
 <br></br>
 
 
@@ -1244,13 +1165,12 @@ function will send a message to the corresponding process, or fail if there
 is no such process. If Key is for a non-unique object type (counter or
 property), Msg will be send to all processes that have such an object.<a name="set_env-5"></a>
 
-<h3>set_env/5</h3>
-
+###set_env/5##
 
 
 
 
-<pre>set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Value::term(), Strategy) -> Value</pre>
+<pre>set_env(Scope::[scope()](#type-scope), App::atom(), Key::atom(), Value::term(), Strategy) -&gt; Value</pre>
 <ul class="definitions"><li><pre>Strategy = [Alternative]</pre></li><li><pre>Alternative = app_env | os_env | {os_env, VAR} | {mnesia, ActivityType, Oid, Pos}</pre></li></ul>
 
 
@@ -1271,13 +1191,12 @@ object, changing only the `Pos` position. If no such object exists, it will
 create a new object, setting any other attributes (except `Pos` and the key)
 to `undefined`.<a name="set_value-2"></a>
 
-<h3>set_value/2</h3>
-
+###set_value/2##
 
 
 
 
-<pre>set_value(Key::<a href="#type-key">key()</a>, Value) -> true</pre>
+<pre>set_value(Key::[key()](#type-key), Value) -&gt; true</pre>
 <br></br>
 
 
@@ -1295,13 +1214,12 @@ If it doesn't, this function will exit.
 Value can be any term, unless the object is a counter, in which case
 it must be an integer.<a name="start_link-0"></a>
 
-<h3>start_link/0</h3>
+###start_link/0##
 
 
 
 
-
-<pre>start_link() -> {ok, pid()}</pre>
+<pre>start_link() -&gt; {ok, pid()}</pre>
 <br></br>
 
 
@@ -1314,13 +1232,12 @@ Starts the gproc server.
 This function is intended to be called from gproc_sup, as part of
 starting the gproc application.<a name="table-0"></a>
 
-<h3>table/0</h3>
-
+###table/0##
 
 
 
 
-<pre>table() -> any()</pre>
+<pre>table() -&gt; any()</pre>
 <br></br>
 
 
@@ -1328,13 +1245,12 @@ starting the gproc application.<a name="table-0"></a>
 
 Equivalent to [`table({all, all})`](#table-1).<a name="table-1"></a>
 
-<h3>table/1</h3>
-
+###table/1##
 
 
 
 
-<pre>table(Context::<a href="#type-context">context()</a>) -> any()</pre>
+<pre>table(Context::[context()](#type-context)) -&gt; any()</pre>
 <br></br>
 
 
@@ -1342,13 +1258,12 @@ Equivalent to [`table({all, all})`](#table-1).<a name="table-1"></a>
 
 Equivalent to [`table(Context, [])`](#table-2).<a name="table-2"></a>
 
-<h3>table/2</h3>
+###table/2##
 
 
 
 
-
-<pre>table(Context::<a href="#type-context">context()</a>, Opts) -> any()</pre>
+<pre>table(Context::[context()](#type-context), Opts) -&gt; any()</pre>
 <br></br>
 
 
@@ -1358,13 +1273,12 @@ QLC table generator for the gproc registry.
 Context specifies which subset of the registry should be queried.
 See [`http://www.erlang.org/doc/man/qlc.html`](http://www.erlang.org/doc/man/qlc.html).<a name="unreg-1"></a>
 
-<h3>unreg/1</h3>
-
+###unreg/1##
 
 
 
 
-<pre>unreg(Key::<a href="#type-key">key()</a>) -> true</pre>
+<pre>unreg(Key::[key()](#type-key)) -&gt; true</pre>
 <br></br>
 
 
@@ -1372,13 +1286,12 @@ See [`http://www.erlang.org/doc/man/qlc.html`](http://www.erlang.org/doc/man/qlc
 
 Unregister a name or property.<a name="unreg_shared-1"></a>
 
-<h3>unreg_shared/1</h3>
-
+###unreg_shared/1##
 
 
 
 
-<pre>unreg_shared(Key::<a href="#type-key">key()</a>) -> true</pre>
+<pre>unreg_shared(Key::[key()](#type-key)) -&gt; true</pre>
 <br></br>
 
 
@@ -1386,8 +1299,7 @@ Unregister a name or property.<a name="unreg_shared-1"></a>
 
 Unregister a shared resource.<a name="unregister_name-1"></a>
 
-<h3>unregister_name/1</h3>
-
+###unregister_name/1##
 
 
 
@@ -1398,13 +1310,12 @@ Unregister a shared resource.<a name="unregister_name-1"></a>
 
 Equivalent to `unreg / 1`.<a name="update_counter-2"></a>
 
-<h3>update_counter/2</h3>
-
+###update_counter/2##
 
 
 
 
-<pre>update_counter(Key::<a href="#type-key">key()</a>, Incr::integer()) -> integer()</pre>
+<pre>update_counter(Key::[key()](#type-key), Incr::integer()) -&gt; integer()</pre>
 <br></br>
 
 
@@ -1418,8 +1329,7 @@ This function works like ets:update_counter/3
 (see [`http://www.erlang.org/doc/man/ets.html#update_counter-3`](http://www.erlang.org/doc/man/ets.html#update_counter-3)), but
 will fail if the type of object referred to by Key is not a counter.<a name="update_shared_counter-2"></a>
 
-<h3>update_shared_counter/2</h3>
-
+###update_shared_counter/2##
 
 
 
@@ -1428,13 +1338,12 @@ will fail if the type of object referred to by Key is not a counter.<a name="upd
 
 <a name="where-1"></a>
 
-<h3>where/1</h3>
+###where/1##
 
 
 
 
-
-<pre>where(Key::<a href="#type-key">key()</a>) -> pid()</pre>
+<pre>where(Key::[key()](#type-key)) -&gt; pid()</pre>
 <br></br>
 
 
@@ -1448,8 +1357,7 @@ The type of registration entry must be either name or aggregated counter.
 Otherwise this function will exit. Use [`lookup_pids/1`](#lookup_pids-1) in these
 cases.<a name="whereis_name-1"></a>
 
-<h3>whereis_name/1</h3>
-
+###whereis_name/1##
 
 
 

+ 8 - 16
doc/gproc_app.md

@@ -1,9 +1,6 @@
-Module gproc_app
-================
 
 
-<h1>Module gproc_app</h1>
-
+#Module gproc_app#
 * [Function Index](#index)
 * [Function Details](#functions)
 
@@ -12,24 +9,21 @@ Module gproc_app
 
 
 
-__Behaviours:__ [`application`](application.md).
-
-<h2><a name="index">Function Index</a></h2>
+__Behaviours:__ [`application`](application.md).<a name="index"></a>
 
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#start-0">start/0</a></td><td></td></tr><tr><td valign="top"><a href="#start-2">start/2</a></td><td></td></tr><tr><td valign="top"><a href="#stop-1">stop/1</a></td><td></td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="start-0"></a>
 
-<h3>start/0</h3>
-
+###start/0##
 
 
 
@@ -38,8 +32,7 @@ __Behaviours:__ [`application`](application.md).
 
 <a name="start-2"></a>
 
-<h3>start/2</h3>
-
+###start/2##
 
 
 
@@ -48,8 +41,7 @@ __Behaviours:__ [`application`](application.md).
 
 <a name="stop-1"></a>
 
-<h3>stop/1</h3>
-
+###stop/1##
 
 
 

+ 41 - 78
doc/gproc_dist.md

@@ -1,9 +1,6 @@
-Module gproc_dist
-=================
 
 
-<h1>Module gproc_dist</h1>
-
+#Module gproc_dist#
 * [Description](#description)
 * [Function Index](#index)
 * [Function Details](#functions)
@@ -13,21 +10,19 @@ Extended process registry.
 
 
 
-__Behaviours:__ [`gen_leader`](/Users/uwiger/ETC/git/gproc/deps/gen_leader/doc/gen_leader.md).
-
-__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
+__Behaviours:__ [`gen_leader`](/Users/uwiger/FL/git/gproc/deps/gen_leader/doc/gen_leader.md).
 
-<h2><a name="description">Description</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="description"></a>
 
+##Description##
 
 
 This module implements an extended process registry
 
 
-For a detailed description, see gproc/doc/erlang07-wiger.pdf.
-
-<h2><a name="index">Function Index</a></h2>
+For a detailed description, see gproc/doc/erlang07-wiger.pdf.<a name="index"></a>
 
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#code_change-4">code_change/4</a></td><td></td></tr><tr><td valign="top"><a href="#elected-2">elected/2</a></td><td></td></tr><tr><td valign="top"><a href="#elected-3">elected/3</a></td><td></td></tr><tr><td valign="top"><a href="#from_leader-3">from_leader/3</a></td><td></td></tr><tr><td valign="top"><a href="#get_leader-0">get_leader/0</a></td><td>Returns the node of the current gproc leader.</td></tr><tr><td valign="top"><a href="#give_away-2">give_away/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_DOWN-3">handle_DOWN/3</a></td><td></td></tr><tr><td valign="top"><a href="#handle_call-4">handle_call/4</a></td><td></td></tr><tr><td valign="top"><a href="#handle_cast-3">handle_cast/3</a></td><td></td></tr><tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_leader_call-4">handle_leader_call/4</a></td><td></td></tr><tr><td valign="top"><a href="#handle_leader_cast-3">handle_leader_cast/3</a></td><td></td></tr><tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr><tr><td valign="top"><a href="#leader_call-1">leader_call/1</a></td><td></td></tr><tr><td valign="top"><a href="#leader_cast-1">leader_cast/1</a></td><td></td></tr><tr><td valign="top"><a href="#mreg-2">mreg/2</a></td><td></td></tr><tr><td valign="top"><a href="#munreg-2">munreg/2</a></td><td></td></tr><tr><td valign="top"><a href="#reg-1">reg/1</a></td><td></td></tr><tr><td valign="top"><a href="#reg-2">reg/2</a></td><td>
@@ -38,15 +33,13 @@ Class = n  - unique name
 Scope = l | g (global or local).</td></tr><tr><td valign="top"><a href="#reg_shared-2">reg_shared/2</a></td><td></td></tr><tr><td valign="top"><a href="#reset_counter-1">reset_counter/1</a></td><td></td></tr><tr><td valign="top"><a href="#set_value-2">set_value/2</a></td><td></td></tr><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td></td></tr><tr><td valign="top"><a href="#start_link-1">start_link/1</a></td><td></td></tr><tr><td valign="top"><a href="#surrendered-3">surrendered/3</a></td><td></td></tr><tr><td valign="top"><a href="#sync-0">sync/0</a></td><td>Synchronize with the gproc leader.</td></tr><tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td></td></tr><tr><td valign="top"><a href="#unreg-1">unreg/1</a></td><td></td></tr><tr><td valign="top"><a href="#unreg_shared-1">unreg_shared/1</a></td><td></td></tr><tr><td valign="top"><a href="#update_counter-2">update_counter/2</a></td><td></td></tr><tr><td valign="top"><a href="#update_shared_counter-2">update_shared_counter/2</a></td><td></td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="code_change-4"></a>
 
-<h3>code_change/4</h3>
-
+###code_change/4##
 
 
 
@@ -55,8 +48,7 @@ Scope = l | g (global or local).</td></tr><tr><td valign="top"><a href="#reg_sha
 
 <a name="elected-2"></a>
 
-<h3>elected/2</h3>
-
+###elected/2##
 
 
 
@@ -65,8 +57,7 @@ Scope = l | g (global or local).</td></tr><tr><td valign="top"><a href="#reg_sha
 
 <a name="elected-3"></a>
 
-<h3>elected/3</h3>
-
+###elected/3##
 
 
 
@@ -75,8 +66,7 @@ Scope = l | g (global or local).</td></tr><tr><td valign="top"><a href="#reg_sha
 
 <a name="from_leader-3"></a>
 
-<h3>from_leader/3</h3>
-
+###from_leader/3##
 
 
 
@@ -85,13 +75,12 @@ Scope = l | g (global or local).</td></tr><tr><td valign="top"><a href="#reg_sha
 
 <a name="get_leader-0"></a>
 
-<h3>get_leader/0</h3>
+###get_leader/0##
 
 
 
 
-
-<pre>get_leader() -> node()</pre>
+<pre>get_leader() -&gt; node()</pre>
 <br></br>
 
 
@@ -99,8 +88,7 @@ Scope = l | g (global or local).</td></tr><tr><td valign="top"><a href="#reg_sha
 
 Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
-<h3>give_away/2</h3>
-
+###give_away/2##
 
 
 
@@ -109,8 +97,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="handle_DOWN-3"></a>
 
-<h3>handle_DOWN/3</h3>
-
+###handle_DOWN/3##
 
 
 
@@ -119,8 +106,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="handle_call-4"></a>
 
-<h3>handle_call/4</h3>
-
+###handle_call/4##
 
 
 
@@ -129,8 +115,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="handle_cast-3"></a>
 
-<h3>handle_cast/3</h3>
-
+###handle_cast/3##
 
 
 
@@ -139,8 +124,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="handle_info-2"></a>
 
-<h3>handle_info/2</h3>
-
+###handle_info/2##
 
 
 
@@ -149,8 +133,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="handle_leader_call-4"></a>
 
-<h3>handle_leader_call/4</h3>
-
+###handle_leader_call/4##
 
 
 
@@ -159,8 +142,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="handle_leader_cast-3"></a>
 
-<h3>handle_leader_cast/3</h3>
-
+###handle_leader_cast/3##
 
 
 
@@ -169,8 +151,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="init-1"></a>
 
-<h3>init/1</h3>
-
+###init/1##
 
 
 
@@ -179,8 +160,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="leader_call-1"></a>
 
-<h3>leader_call/1</h3>
-
+###leader_call/1##
 
 
 
@@ -189,8 +169,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="leader_cast-1"></a>
 
-<h3>leader_cast/1</h3>
-
+###leader_cast/1##
 
 
 
@@ -199,8 +178,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="mreg-2"></a>
 
-<h3>mreg/2</h3>
-
+###mreg/2##
 
 
 
@@ -209,8 +187,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="munreg-2"></a>
 
-<h3>munreg/2</h3>
-
+###munreg/2##
 
 
 
@@ -219,8 +196,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="reg-1"></a>
 
-<h3>reg/1</h3>
-
+###reg/1##
 
 
 
@@ -229,8 +205,7 @@ Returns the node of the current gproc leader.<a name="give_away-2"></a>
 
 <a name="reg-2"></a>
 
-<h3>reg/2</h3>
-
+###reg/2##
 
 
 
@@ -246,8 +221,7 @@ Class = n  - unique name
 | a  - aggregated counter
 Scope = l | g (global or local)<a name="reg_shared-2"></a>
 
-<h3>reg_shared/2</h3>
-
+###reg_shared/2##
 
 
 
@@ -256,8 +230,7 @@ Scope = l | g (global or local)<a name="reg_shared-2"></a>
 
 <a name="reset_counter-1"></a>
 
-<h3>reset_counter/1</h3>
-
+###reset_counter/1##
 
 
 
@@ -266,8 +239,7 @@ Scope = l | g (global or local)<a name="reg_shared-2"></a>
 
 <a name="set_value-2"></a>
 
-<h3>set_value/2</h3>
-
+###set_value/2##
 
 
 
@@ -276,8 +248,7 @@ Scope = l | g (global or local)<a name="reg_shared-2"></a>
 
 <a name="start_link-0"></a>
 
-<h3>start_link/0</h3>
-
+###start_link/0##
 
 
 
@@ -286,8 +257,7 @@ Scope = l | g (global or local)<a name="reg_shared-2"></a>
 
 <a name="start_link-1"></a>
 
-<h3>start_link/1</h3>
-
+###start_link/1##
 
 
 
@@ -296,8 +266,7 @@ Scope = l | g (global or local)<a name="reg_shared-2"></a>
 
 <a name="surrendered-3"></a>
 
-<h3>surrendered/3</h3>
-
+###surrendered/3##
 
 
 
@@ -306,13 +275,12 @@ Scope = l | g (global or local)<a name="reg_shared-2"></a>
 
 <a name="sync-0"></a>
 
-<h3>sync/0</h3>
+###sync/0##
 
 
 
 
-
-<pre>sync() -> true</pre>
+<pre>sync() -&gt; true</pre>
 <br></br>
 
 
@@ -331,8 +299,7 @@ during an ongoing sync, the call will fail with a timeout exception.
 out why gen_leader times out in this situation, rather than reporting that
 the leader died.)<a name="terminate-2"></a>
 
-<h3>terminate/2</h3>
-
+###terminate/2##
 
 
 
@@ -341,8 +308,7 @@ the leader died.)<a name="terminate-2"></a>
 
 <a name="unreg-1"></a>
 
-<h3>unreg/1</h3>
-
+###unreg/1##
 
 
 
@@ -351,8 +317,7 @@ the leader died.)<a name="terminate-2"></a>
 
 <a name="unreg_shared-1"></a>
 
-<h3>unreg_shared/1</h3>
-
+###unreg_shared/1##
 
 
 
@@ -361,8 +326,7 @@ the leader died.)<a name="terminate-2"></a>
 
 <a name="update_counter-2"></a>
 
-<h3>update_counter/2</h3>
-
+###update_counter/2##
 
 
 
@@ -371,8 +335,7 @@ the leader died.)<a name="terminate-2"></a>
 
 <a name="update_shared_counter-2"></a>
 
-<h3>update_shared_counter/2</h3>
-
+###update_shared_counter/2##
 
 
 

+ 7 - 13
doc/gproc_info.md

@@ -1,9 +1,6 @@
-Module gproc_info
-=================
 
 
-<h1>Module gproc_info</h1>
-
+#Module gproc_info#
 * [Function Index](#index)
 * [Function Details](#functions)
 
@@ -12,29 +9,26 @@ Module gproc_info
 
 
 
-__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
-
-<h2><a name="index">Function Index</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="index"></a>
 
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#i-0">i/0</a></td><td></td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="i-0"></a>
 
-<h3>i/0</h3>
-
+###i/0##
 
 
 
 
-<pre>i() -> ok</pre>
+<pre>i() -&gt; ok</pre>
 <br></br>
 
 

+ 9 - 16
doc/gproc_init.md

@@ -1,50 +1,43 @@
-Module gproc_init
-=================
 
 
-<h1>Module gproc_init</h1>
-
+#Module gproc_init#
 * [Function Index](#index)
 * [Function Details](#functions)
 
 
 
 
+<a name="index"></a>
 
-
-<h2><a name="index">Function Index</a></h2>
-
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#hard_reset-0">hard_reset/0</a></td><td></td></tr><tr><td valign="top"><a href="#soft_reset-0">soft_reset/0</a></td><td></td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="hard_reset-0"></a>
 
-<h3>hard_reset/0</h3>
-
+###hard_reset/0##
 
 
 
 
-<pre>hard_reset() -> ok</pre>
+<pre>hard_reset() -&gt; ok</pre>
 <br></br>
 
 
 <a name="soft_reset-0"></a>
 
-<h3>soft_reset/0</h3>
-
+###soft_reset/0##
 
 
 
 
-<pre>soft_reset() -> ok</pre>
+<pre>soft_reset() -&gt; ok</pre>
 <br></br>
 
 

+ 28 - 53
doc/gproc_lib.md

@@ -1,9 +1,6 @@
-Module gproc_lib
-================
 
 
-<h1>Module gproc_lib</h1>
-
+#Module gproc_lib#
 * [Description](#description)
 * [Function Index](#index)
 * [Function Details](#functions)
@@ -13,33 +10,29 @@ Extended process registry.
 
 
 
-__Authors:__ Ulf Wiger ([`ulf.wiger@ericsson.com`](mailto:ulf.wiger@ericsson.com)).
-
-<h2><a name="description">Description</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@ericsson.com`](mailto:ulf.wiger@ericsson.com)).<a name="description"></a>
 
+##Description##
 
 
 This module implements an extended process registry
 
 
-For a detailed description, see gproc/doc/erlang07-wiger.pdf.
-
-<h2><a name="index">Function Index</a></h2>
+For a detailed description, see gproc/doc/erlang07-wiger.pdf.<a name="index"></a>
 
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#add_monitor-3">add_monitor/3</a></td><td></td></tr><tr><td valign="top"><a href="#await-3">await/3</a></td><td></td></tr><tr><td valign="top"><a href="#do_set_counter_value-3">do_set_counter_value/3</a></td><td></td></tr><tr><td valign="top"><a href="#do_set_value-3">do_set_value/3</a></td><td></td></tr><tr><td valign="top"><a href="#ensure_monitor-2">ensure_monitor/2</a></td><td></td></tr><tr><td valign="top"><a href="#insert_many-4">insert_many/4</a></td><td></td></tr><tr><td valign="top"><a href="#insert_reg-4">insert_reg/4</a></td><td></td></tr><tr><td valign="top"><a href="#notify-2">notify/2</a></td><td></td></tr><tr><td valign="top"><a href="#notify-3">notify/3</a></td><td></td></tr><tr><td valign="top"><a href="#remove_many-4">remove_many/4</a></td><td></td></tr><tr><td valign="top"><a href="#remove_monitor-3">remove_monitor/3</a></td><td></td></tr><tr><td valign="top"><a href="#remove_monitors-3">remove_monitors/3</a></td><td></td></tr><tr><td valign="top"><a href="#remove_reg-3">remove_reg/3</a></td><td></td></tr><tr><td valign="top"><a href="#remove_reg-4">remove_reg/4</a></td><td></td></tr><tr><td valign="top"><a href="#remove_reverse_mapping-3">remove_reverse_mapping/3</a></td><td></td></tr><tr><td valign="top"><a href="#remove_wait-4">remove_wait/4</a></td><td></td></tr><tr><td valign="top"><a href="#update_aggr_counter-3">update_aggr_counter/3</a></td><td></td></tr><tr><td valign="top"><a href="#update_counter-3">update_counter/3</a></td><td></td></tr><tr><td valign="top"><a href="#valid_opts-2">valid_opts/2</a></td><td></td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="add_monitor-3"></a>
 
-<h3>add_monitor/3</h3>
-
+###add_monitor/3##
 
 
 
@@ -48,8 +41,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="await-3"></a>
 
-<h3>await/3</h3>
-
+###await/3##
 
 
 
@@ -58,8 +50,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="do_set_counter_value-3"></a>
 
-<h3>do_set_counter_value/3</h3>
-
+###do_set_counter_value/3##
 
 
 
@@ -68,8 +59,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="do_set_value-3"></a>
 
-<h3>do_set_value/3</h3>
-
+###do_set_value/3##
 
 
 
@@ -78,8 +68,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="ensure_monitor-2"></a>
 
-<h3>ensure_monitor/2</h3>
-
+###ensure_monitor/2##
 
 
 
@@ -88,32 +77,29 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="insert_many-4"></a>
 
-<h3>insert_many/4</h3>
-
+###insert_many/4##
 
 
 
 
-<pre>insert_many(T::<a href="#type-type">type()</a>, Scope::<a href="#type-scope">scope()</a>, KVL::[{<a href="#type-key">key()</a>, any()}], Pid::pid()) -> {true, list()} | false</pre>
+<pre>insert_many(T::[type()](#type-type), Scope::[scope()](#type-scope), KVL::[{[key()](#type-key), any()}], Pid::pid()) -&gt; {true, list()} | false</pre>
 <br></br>
 
 
 <a name="insert_reg-4"></a>
 
-<h3>insert_reg/4</h3>
-
+###insert_reg/4##
 
 
 
 
-<pre>insert_reg(K::<a href="#type-key">key()</a>, Value::any(), Pid::pid() | shared, Scope::<a href="#type-scope">scope()</a>) -> boolean()</pre>
+<pre>insert_reg(K::[key()](#type-key), Value::any(), Pid::pid() | shared, Scope::[scope()](#type-scope)) -&gt; boolean()</pre>
 <br></br>
 
 
 <a name="notify-2"></a>
 
-<h3>notify/2</h3>
-
+###notify/2##
 
 
 
@@ -122,8 +108,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="notify-3"></a>
 
-<h3>notify/3</h3>
-
+###notify/3##
 
 
 
@@ -132,8 +117,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="remove_many-4"></a>
 
-<h3>remove_many/4</h3>
-
+###remove_many/4##
 
 
 
@@ -142,8 +126,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="remove_monitor-3"></a>
 
-<h3>remove_monitor/3</h3>
-
+###remove_monitor/3##
 
 
 
@@ -152,8 +135,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="remove_monitors-3"></a>
 
-<h3>remove_monitors/3</h3>
-
+###remove_monitors/3##
 
 
 
@@ -162,8 +144,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="remove_reg-3"></a>
 
-<h3>remove_reg/3</h3>
-
+###remove_reg/3##
 
 
 
@@ -172,8 +153,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="remove_reg-4"></a>
 
-<h3>remove_reg/4</h3>
-
+###remove_reg/4##
 
 
 
@@ -182,8 +162,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="remove_reverse_mapping-3"></a>
 
-<h3>remove_reverse_mapping/3</h3>
-
+###remove_reverse_mapping/3##
 
 
 
@@ -192,8 +171,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="remove_wait-4"></a>
 
-<h3>remove_wait/4</h3>
-
+###remove_wait/4##
 
 
 
@@ -202,8 +180,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="update_aggr_counter-3"></a>
 
-<h3>update_aggr_counter/3</h3>
-
+###update_aggr_counter/3##
 
 
 
@@ -212,8 +189,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="update_counter-3"></a>
 
-<h3>update_counter/3</h3>
-
+###update_counter/3##
 
 
 
@@ -222,8 +198,7 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 <a name="valid_opts-2"></a>
 
-<h3>valid_opts/2</h3>
-
+###valid_opts/2##
 
 
 

+ 11 - 19
doc/gproc_monitor.md

@@ -1,9 +1,6 @@
-Module gproc_monitor
-====================
 
 
-<h1>Module gproc_monitor</h1>
-
+#Module gproc_monitor#
 * [Description](#description)
 * [Function Index](#index)
 * [Function Details](#functions)
@@ -18,10 +15,9 @@ will be sent each time that name is registered.
 
 __Behaviours:__ [`gen_server`](gen_server.md).
 
-__Authors:__ Ulf Wiger ([`ulf.wiger@feuerlabs.com`](mailto:ulf.wiger@feuerlabs.com)).
-
-<h2><a name="index">Function Index</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@feuerlabs.com`](mailto:ulf.wiger@feuerlabs.com)).<a name="index"></a>
 
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>
@@ -30,20 +26,18 @@ Subscribe to registration events for a certain name.</td></tr><tr><td valign="to
 Unsubscribe from registration events for a certain name.</td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="start_link-0"></a>
 
-<h3>start_link/0</h3>
+###start_link/0##
 
 
 
 
-
-<pre>start_link() -> {ok, Pid} | ignore | {error, Error}</pre>
+<pre>start_link() -&gt; {ok, Pid} | ignore | {error, Error}</pre>
 <br></br>
 
 
@@ -53,13 +47,12 @@ Unsubscribe from registration events for a certain name.</td></tr></table>
 Starts the server
 <a name="subscribe-1"></a>
 
-<h3>subscribe/1</h3>
-
+###subscribe/1##
 
 
 
 
-<pre>subscribe(Key::<a href="#type-key">key()</a>) -> ok</pre>
+<pre>subscribe(Key::[key()](#type-key)) -&gt; ok</pre>
 <br></br>
 
 
@@ -80,13 +73,12 @@ either explicitly, or because the registered process dies.
 When the subscription is first ordered, one of the above messages will be
 sent immediately, indicating the current status of the name.<a name="unsubscribe-1"></a>
 
-<h3>unsubscribe/1</h3>
-
+###unsubscribe/1##
 
 
 
 
-<pre>unsubscribe(Key::<a href="#type-key">key()</a>) -> ok</pre>
+<pre>unsubscribe(Key::[key()](#type-key)) -&gt; ok</pre>
 <br></br>
 
 

+ 7 - 14
doc/gproc_sup.md

@@ -1,9 +1,6 @@
-Module gproc_sup
-================
 
 
-<h1>Module gproc_sup</h1>
-
+#Module gproc_sup#
 * [Function Index](#index)
 * [Function Details](#functions)
 
@@ -12,24 +9,21 @@ Module gproc_sup
 
 
 
-__Behaviours:__ [`supervisor`](supervisor.md).
-
-<h2><a name="index">Function Index</a></h2>
+__Behaviours:__ [`supervisor`](supervisor.md).<a name="index"></a>
 
+##Function Index##
 
 
 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#init-1">init/1</a></td><td>The main GPROC supervisor.</td></tr><tr><td valign="top"><a href="#start_link-1">start_link/1</a></td><td></td></tr></table>
 
 
+<a name="functions"></a>
 
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
 
 <a name="init-1"></a>
 
-<h3>init/1</h3>
-
+###init/1##
 
 
 
@@ -40,8 +34,7 @@ __Behaviours:__ [`supervisor`](supervisor.md).
 
 The main GPROC supervisor.<a name="start_link-1"></a>
 
-<h3>start_link/1</h3>
-
+###start_link/1##
 
 
 

+ 23 - 1
src/gproc.erl

@@ -610,7 +610,19 @@ await({n,g,_} = Key, Timeout) ->
 await({n,l,_} = Key, Timeout) ->
     case ets:lookup(?TAB, {Key, n}) of
         [{_, Pid, Value}] ->
-            {Pid, Value};
+	    case is_process_alive(Pid) of
+		true ->
+		    {Pid, Value};
+		false ->
+		    %% we can send an asynchronous audit request, since the purpose is
+		    %% only to ensure that the server handles the audit before it serves
+		    %% our 'await' request. Strictly speaking, we could allow the bad Pid
+		    %% to be returned, as there are no guarantees that whatever Pid we return
+		    %% will still be alive when addressed. Still, we don't want to knowingly
+		    %% serve bad data.
+		    nb_audit_process(Pid),
+		    request_wait(Key, Timeout)
+	    end;
         _ ->
             request_wait(Key, Timeout)
     end;
@@ -1405,6 +1417,14 @@ i() ->
 handle_cast({monitor_me, Pid}, S) ->
     erlang:monitor(process, Pid),
     {noreply, S};
+handle_cast({audit_process, Pid}, S) ->
+    case is_process_alive(Pid) of
+	false ->
+	    process_is_down(Pid);
+	true ->
+	    ignore
+    end,
+    {noreply, S};
 handle_cast({cancel_wait, Pid, {T,_,_} = Key, Ref}, S) ->
      _ = case ets:lookup(?TAB, {Key,T}) of
 	     [{_, Waiters}] ->
@@ -1615,6 +1635,8 @@ try_insert_reg({T,l,_} = Key, Val, Pid) ->
 audit_process(Pid) when is_pid(Pid) ->
     ok = gen_server:call(gproc, {audit_process, Pid}, infinity).
 
+nb_audit_process(Pid) when is_pid(Pid) ->
+    ok = gen_server:cast(gproc, {audit_process, Pid}).
 
 -spec process_is_down(pid()) -> ok.
 

+ 19 - 0
test/gproc_tests.erl

@@ -81,6 +81,8 @@ reg_test_() ->
       , ?_test(t_is_clean())
       , {spawn, ?_test(?debugVal(t_await_self()))}
       , ?_test(t_is_clean())
+      , {spawn, ?_test(?debugVal(t_await_crash()))}
+      , ?_test(t_is_clean())
       , {spawn, ?_test(?debugVal(t_simple_mreg()))}
       , ?_test(t_is_clean())
       , {spawn, ?_test(?debugVal(t_gproc_crash()))}
@@ -201,6 +203,23 @@ t_await_self() ->
 			       timeout
 		       end).
 
+t_await_crash() ->
+    Name = {n,l,{dummy,?LINE}},
+    {Pid,_} = spawn_regger(Name),
+    ?assertEqual({Pid,undefined}, gproc:await(Name, 1000)),
+    exit(Pid, kill),
+    {NewPid,MRef} = spawn_regger(Name),
+    ?assertEqual(false, is_process_alive(Pid)),
+    ?assertEqual({NewPid,undefined}, gproc:await(Name, 1000)),
+    exit(NewPid, kill),
+    receive {'DOWN', MRef, _, _, _} -> ok end.
+
+spawn_regger(Name) ->
+    spawn_monitor(fun() ->
+			  gproc:reg(Name),
+			  timer:sleep(60000)
+		  end).
+
 t_is_clean() ->
     sys:get_status(gproc), % in order to synch
     sys:get_status(gproc_monitor),