Browse Source

fix lines that were too long

Ulf Wiger 14 years ago
parent
commit
e46cabfdd3
6 changed files with 40 additions and 38 deletions
  1. 11 10
      doc/gproc.md
  2. 3 3
      doc/gproc_dist.md
  3. 12 12
      src/gproc.erl
  4. 11 11
      src/gproc_dist.erl
  5. 2 1
      src/gproc_init.erl
  6. 1 1
      src/gproc_sup.erl

+ 11 - 10
doc/gproc.md

@@ -163,7 +163,7 @@ Type and scope for select(), qlc() and stepping:
 
 
 
 
 
 
-<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="#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></td></tr><tr><td valign="top"><a href="#default-1">default/1</a></td><td></td></tr><tr><td valign="top"><a href="#first-1">first/1</a></td><td>Behaves as ets:first(Tab) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#get_env-3">get_env/3</a></td><td>Equivalent to <a href="#get_env-4"><tt>get_env(Scope, App, Key, [app_env])</tt></a>.</td></tr><tr><td valign="top"><a href="#get_env-4">get_env/4</a></td><td>Fetch an environment value, potentially cached as a <code>gproc_env</code> property.</td></tr><tr><td valign="top"><a href="#get_set_env-3">get_set_env/3</a></td><td>Equivalent to <a href="#get_set_env-4"><tt>get_set_env(Scope, App, Key, [app_env])</tt></a>.</td></tr><tr><td valign="top"><a href="#get_set_env-4">get_set_env/4</a></td><td>Fetch and cache an environment value, if not already cached.</td></tr><tr><td valign="top"><a href="#get_value-1">get_value/1</a></td><td>Read the value stored with a key registered to the current process.</td></tr><tr><td valign="top"><a href="#give_away-2">give_away/2</a></td><td>Atomically transfers the key <code>From</code> to the process identified by <code>To</code>.</td></tr><tr><td valign="top"><a href="#info-1">info/1</a></td><td>Similar to <code>process_info(Pid)</code> but with additional gproc info.</td></tr><tr><td valign="top"><a href="#info-2">info/2</a></td><td>Similar to process_info(Pid, Item), but with additional gproc info.</td></tr><tr><td valign="top"><a href="#last-1">last/1</a></td><td>Behaves as ets:last(Tab) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#lookup_global_aggr_counter-1">lookup_global_aggr_counter/1</a></td><td>Lookup a global (unique) aggregated counter and returns its value.</td></tr><tr><td valign="top"><a href="#lookup_global_counters-1">lookup_global_counters/1</a></td><td>Look up all global (non-unique) instances of a given Counter.</td></tr><tr><td valign="top"><a href="#lookup_global_name-1">lookup_global_name/1</a></td><td>Lookup a global unique name.</td></tr><tr><td valign="top"><a href="#lookup_global_properties-1">lookup_global_properties/1</a></td><td>Look up all global (non-unique) instances of a given Property.</td></tr><tr><td valign="top"><a href="#lookup_local_aggr_counter-1">lookup_local_aggr_counter/1</a></td><td>Lookup a local (unique) aggregated counter and returns its value.</td></tr><tr><td valign="top"><a href="#lookup_local_counters-1">lookup_local_counters/1</a></td><td>Look up all local (non-unique) instances of a given Counter.</td></tr><tr><td valign="top"><a href="#lookup_local_name-1">lookup_local_name/1</a></td><td>Lookup a local unique name.</td></tr><tr><td valign="top"><a href="#lookup_local_properties-1">lookup_local_properties/1</a></td><td>Look up all local (non-unique) instances of a given Property.</td></tr><tr><td valign="top"><a href="#lookup_pid-1">lookup_pid/1</a></td><td>Lookup the Pid stored with a key.</td></tr><tr><td valign="top"><a href="#lookup_pids-1">lookup_pids/1</a></td><td>Returns a list of pids with the published key Key.</td></tr><tr><td valign="top"><a href="#lookup_value-1">lookup_value/1</a></td><td>Lookup the value stored with a key.</td></tr><tr><td valign="top"><a href="#lookup_values-1">lookup_values/1</a></td><td>Retrieve the <code>{Pid,Value}</code> pairs corresponding to Key.</td></tr><tr><td valign="top"><a href="#mreg-3">mreg/3</a></td><td>Register multiple {Key,Value} pairs of a given type and scope.</td></tr><tr><td valign="top"><a href="#munreg-3">munreg/3</a></td><td>Unregister multiple Key items of a given type and scope.</td></tr><tr><td valign="top"><a href="#nb_wait-1">nb_wait/1</a></td><td>Wait for a local name to be registered.</td></tr><tr><td valign="top"><a href="#next-2">next/2</a></td><td>Behaves as ets:next(Tab,Key) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#prev-2">prev/2</a></td><td>Behaves as ets:prev(Tab,Key) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#reg-1">reg/1</a></td><td>Equivalent to <a href="#reg-2"><tt>reg(Key, default(Key))</tt></a>.</td></tr><tr><td valign="top"><a href="#reg-2">reg/2</a></td><td>Register a name or property for the current process.</td></tr><tr><td valign="top"><a href="#select-1">select/1</a></td><td>Equivalent to <a href="#select-2"><tt>select(all, Pat)</tt></a>.</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="#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-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="#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="#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>
+<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="#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></td></tr><tr><td valign="top"><a href="#default-1">default/1</a></td><td></td></tr><tr><td valign="top"><a href="#first-1">first/1</a></td><td>Behaves as ets:first(Tab) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#get_env-3">get_env/3</a></td><td>Equivalent to <a href="#get_env-4"><tt>get_env(Scope, App, Key, [app_env])</tt></a>.</td></tr><tr><td valign="top"><a href="#get_env-4">get_env/4</a></td><td>Read an environment value, potentially cached as a <code>gproc_env</code> property.</td></tr><tr><td valign="top"><a href="#get_set_env-3">get_set_env/3</a></td><td>Equivalent to <a href="#get_set_env-4"><tt>get_set_env(Scope, App, Key, [app_env])</tt></a>.</td></tr><tr><td valign="top"><a href="#get_set_env-4">get_set_env/4</a></td><td>Fetch and cache an environment value, if not already cached.</td></tr><tr><td valign="top"><a href="#get_value-1">get_value/1</a></td><td>Read the value stored with a key registered to the current process.</td></tr><tr><td valign="top"><a href="#give_away-2">give_away/2</a></td><td>Atomically transfers the key <code>From</code> to the process identified by <code>To</code>.</td></tr><tr><td valign="top"><a href="#info-1">info/1</a></td><td>Similar to <code>process_info(Pid)</code> but with additional gproc info.</td></tr><tr><td valign="top"><a href="#info-2">info/2</a></td><td>Similar to process_info(Pid, Item), but with additional gproc info.</td></tr><tr><td valign="top"><a href="#last-1">last/1</a></td><td>Behaves as ets:last(Tab) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#lookup_global_aggr_counter-1">lookup_global_aggr_counter/1</a></td><td>Lookup a global (unique) aggregated counter and returns its value.</td></tr><tr><td valign="top"><a href="#lookup_global_counters-1">lookup_global_counters/1</a></td><td>Look up all global (non-unique) instances of a given Counter.</td></tr><tr><td valign="top"><a href="#lookup_global_name-1">lookup_global_name/1</a></td><td>Lookup a global unique name.</td></tr><tr><td valign="top"><a href="#lookup_global_properties-1">lookup_global_properties/1</a></td><td>Look up all global (non-unique) instances of a given Property.</td></tr><tr><td valign="top"><a href="#lookup_local_aggr_counter-1">lookup_local_aggr_counter/1</a></td><td>Lookup a local (unique) aggregated counter and returns its value.</td></tr><tr><td valign="top"><a href="#lookup_local_counters-1">lookup_local_counters/1</a></td><td>Look up all local (non-unique) instances of a given Counter.</td></tr><tr><td valign="top"><a href="#lookup_local_name-1">lookup_local_name/1</a></td><td>Lookup a local unique name.</td></tr><tr><td valign="top"><a href="#lookup_local_properties-1">lookup_local_properties/1</a></td><td>Look up all local (non-unique) instances of a given Property.</td></tr><tr><td valign="top"><a href="#lookup_pid-1">lookup_pid/1</a></td><td>Lookup the Pid stored with a key.</td></tr><tr><td valign="top"><a href="#lookup_pids-1">lookup_pids/1</a></td><td>Returns a list of pids with the published key Key.</td></tr><tr><td valign="top"><a href="#lookup_value-1">lookup_value/1</a></td><td>Lookup the value stored with a key.</td></tr><tr><td valign="top"><a href="#lookup_values-1">lookup_values/1</a></td><td>Retrieve the <code>{Pid,Value}</code> pairs corresponding to Key.</td></tr><tr><td valign="top"><a href="#mreg-3">mreg/3</a></td><td>Register multiple {Key,Value} pairs of a given type and scope.</td></tr><tr><td valign="top"><a href="#munreg-3">munreg/3</a></td><td>Unregister multiple Key items of a given type and scope.</td></tr><tr><td valign="top"><a href="#nb_wait-1">nb_wait/1</a></td><td>Wait for a local name to be registered.</td></tr><tr><td valign="top"><a href="#next-2">next/2</a></td><td>Behaves as ets:next(Tab,Key) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#prev-2">prev/2</a></td><td>Behaves as ets:prev(Tab,Key) for a given type of registration object.</td></tr><tr><td valign="top"><a href="#reg-1">reg/1</a></td><td>Equivalent to <a href="#reg-2"><tt>reg(Key, default(Key))</tt></a>.</td></tr><tr><td valign="top"><a href="#reg-2">reg/2</a></td><td>Register a name or property for the current process.</td></tr><tr><td valign="top"><a href="#select-1">select/1</a></td><td>Equivalent to <a href="#select-2"><tt>select(all, Pat)</tt></a>.</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="#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-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="#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="#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>
 
 
 
 
 
 
@@ -384,7 +384,7 @@ Equivalent to [`get_env(Scope, App, Key, [app_env])`](#get_env-4).<a name="get_e
 
 
 
 
 
 
-Fetch an environment value, potentially cached as a `gproc_env` property.
+Read an environment value, potentially cached as a `gproc_env` property.
 
 
 
 
 
 
@@ -399,16 +399,16 @@ Each alternative can be one of:
 * `os_env` - try `os:getenv(ENV)`, where `ENV` is `Key` converted into an
 * `os_env` - try `os:getenv(ENV)`, where `ENV` is `Key` converted into an
 uppercase string
 uppercase string
 * `{os_env, ENV}` - try `os:getenv(ENV)`
 * `{os_env, ENV}` - try `os:getenv(ENV)`
-* `inherit` - inherit the cached value, if any, held by the (proc_lib) parent.
+* `inherit` - inherit the cached value, if any, held by the parent process.
 * `{inherit, Pid}` - inherit the cached value, if any, held by `Pid`.
 * `{inherit, Pid}` - inherit the cached value, if any, held by `Pid`.
 * `{inherit, Id}` - inherit the cached value, if any, held by the process
 * `{inherit, Id}` - inherit the cached value, if any, held by the process
 registered in `gproc` as `Id`.
 registered in `gproc` as `Id`.
 * `init_arg` - try `init:get_argument(Key)`; expects a single value, if any.
 * `init_arg` - try `init:get_argument(Key)`; expects a single value, if any.
 * `{mnesia, ActivityType, Oid, Pos}` - try
 * `{mnesia, ActivityType, Oid, Pos}` - try
-`mnesia:activity(ActivityType, fun() -> mnesia:read(Oid) end)`; retrieve the
-value in position `Pos` if object found.
-* `{default, Value}` - set a default value to return once alternatives have been
-exhausted; if not set, `undefined` will be returned.
+`mnesia:activity(ActivityType, fun() -> mnesia:read(Oid) end)`; retrieve
+the value in position `Pos` if object found.
+* `{default, Value}` - set a default value to return once alternatives have
+been exhausted; if not set, `undefined` will be returned.
 * `error` - raise an exception, `erlang:error(gproc_env, [App, Key, Scope])`.
 * `error` - raise an exception, `erlang:error(gproc_env, [App, Key, Scope])`.
 
 
 
 
@@ -422,14 +422,15 @@ The return value will be one of:
 
 
 
 
 
 
-* The value of the first matching alternative, or exception caused by `error`,
+* The value of the first matching alternative, or `error` eception,
 whichever comes first
 whichever comes first
 * The last instance of `{default, Value}`, or `undefined`, if there is no
 * The last instance of `{default, Value}`, or `undefined`, if there is no
 matching alternative, default or `error` entry in the list.
 matching alternative, default or `error` entry in the list.
 
 
 The `error` option can be used to assert that a value has been previously
 The `error` option can be used to assert that a value has been previously
 cached. Alternatively, it can be used to assert that a value is either cached
 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>
+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>
 <h3>get_set_env/3</h3>
 
 
@@ -504,7 +505,7 @@ Atomically transfers the key `From` to the process identified by `To`.
 
 
 
 
 
 
-This function transfers any gproc key (name, property, counter, aggr. counter)  
+This function transfers any gproc key (name, property, counter, aggr counter)  
 from one process to another, and returns the pid of the new owner.
 from one process to another, and returns the pid of the new owner.
 
 
 
 

+ 3 - 3
doc/gproc_dist.md

@@ -307,9 +307,9 @@ leader to the current node. It does so by asking the leader to ping all
 live participating nodes. The call will return `true` when all these nodes
 live participating nodes. The call will return `true` when all these nodes
 have either responded or died. In the special case where the leader dies
 have either responded or died. In the special case where the leader dies
 during an ongoing sync, the call will fail with a timeout exception.
 during an ongoing sync, the call will fail with a timeout exception.
-(Actually, it should be a `leader_died` exception; more study needed to find out
-why gen_leader times out in this situation, rather than reporting that the
-leader died.)<a name="terminate-2"></a>
+(Actually, it should be a `leader_died` exception; more study needed to find
+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>
 <h3>terminate/2</h3>
 
 

+ 12 - 12
src/gproc.erl

@@ -292,7 +292,7 @@ get_env(Scope, App, Key) ->
 %%               | {mnesia, ActivityType, Oid, Pos}
 %%               | {mnesia, ActivityType, Oid, Pos}
 %%               | {default, term()}
 %%               | {default, term()}
 %%               | error
 %%               | error
-%% @doc Fetch an environment value, potentially cached as a `gproc_env' property.
+%% @doc Read an environment value, potentially cached as a `gproc_env' property.
 %%
 %%
 %% This function first tries to read the value of a cached property,
 %% This function first tries to read the value of a cached property,
 %% `{p, Scope, {gproc_env, App, Key}}'. If this fails, it will try the provided
 %% `{p, Scope, {gproc_env, App, Key}}'. If this fails, it will try the provided
@@ -303,16 +303,16 @@ get_env(Scope, App, Key) ->
 %% * `os_env' - try `os:getenv(ENV)', where `ENV' is `Key' converted into an
 %% * `os_env' - try `os:getenv(ENV)', where `ENV' is `Key' converted into an
 %%   uppercase string
 %%   uppercase string
 %% * `{os_env, ENV}' - try `os:getenv(ENV)'
 %% * `{os_env, ENV}' - try `os:getenv(ENV)'
-%% * `inherit' - inherit the cached value, if any, held by the (proc_lib) parent.
+%% * `inherit' - inherit the cached value, if any, held by the parent process.
 %% * `{inherit, Pid}' - inherit the cached value, if any, held by `Pid'.
 %% * `{inherit, Pid}' - inherit the cached value, if any, held by `Pid'.
 %% * `{inherit, Id}' - inherit the cached value, if any, held by the process
 %% * `{inherit, Id}' - inherit the cached value, if any, held by the process
 %%    registered in `gproc' as `Id'.
 %%    registered in `gproc' as `Id'.
 %% * `init_arg' - try `init:get_argument(Key)'; expects a single value, if any.
 %% * `init_arg' - try `init:get_argument(Key)'; expects a single value, if any.
 %% * `{mnesia, ActivityType, Oid, Pos}' - try
 %% * `{mnesia, ActivityType, Oid, Pos}' - try
-%%   `mnesia:activity(ActivityType, fun() -> mnesia:read(Oid) end)'; retrieve the
-%%    value in position `Pos' if object found.
-%% * `{default, Value}' - set a default value to return once alternatives have been
-%%    exhausted; if not set, `undefined' will be returned.
+%%   `mnesia:activity(ActivityType, fun() -> mnesia:read(Oid) end)'; retrieve
+%%    the value in position `Pos' if object found.
+%% * `{default, Value}' - set a default value to return once alternatives have
+%%    been exhausted; if not set, `undefined' will be returned.
 %% * `error' - raise an exception, `erlang:error(gproc_env, [App, Key, Scope])'.
 %% * `error' - raise an exception, `erlang:error(gproc_env, [App, Key, Scope])'.
 %%
 %%
 %% While any alternative can occur more than once, the only one that might make
 %% While any alternative can occur more than once, the only one that might make
@@ -320,14 +320,15 @@ get_env(Scope, App, Key) ->
 %%
 %%
 %% The return value will be one of:
 %% The return value will be one of:
 %%
 %%
-%% * The value of the first matching alternative, or exception caused by `error',
+%% * The value of the first matching alternative, or `error' eception,
 %%   whichever comes first
 %%   whichever comes first
 %% * The last instance of `{default, Value}', or `undefined', if there is no
 %% * The last instance of `{default, Value}', or `undefined', if there is no
 %%   matching alternative, default or `error' entry in the list.
 %%   matching alternative, default or `error' entry in the list.
 %%
 %%
 %% The `error' option can be used to assert that a value has been previously
 %% The `error' option can be used to assert that a value has been previously
 %% cached. Alternatively, it can be used to assert that a value is either cached
 %% 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])'.
+%% or at least defined somewhere,
+%% e.g. `get_env(l, mnesia, dir, [app_env, error])'.
 %% @end
 %% @end
 get_env(Scope, App, Key, Strategy)
 get_env(Scope, App, Key, Strategy)
   when Scope==l, is_atom(App), is_atom(Key);
   when Scope==l, is_atom(App), is_atom(Key);
@@ -339,7 +340,8 @@ get_env(Scope, App, Key, Strategy)
 get_set_env(Scope, App, Key) ->
 get_set_env(Scope, App, Key) ->
     get_set_env(Scope, App, Key, [app_env]).
     get_set_env(Scope, App, Key, [app_env]).
 
 
-%% @spec get_set_env(Scope::scope(), App::atom(), Key::atom(), Strategy) -> Value
+%% @spec get_set_env(Scope::scope(), App::atom(), Key::atom(), Strategy) ->
+%%           Value
 %% @doc Fetch and cache an environment value, if not already cached.
 %% @doc Fetch and cache an environment value, if not already cached.
 %%
 %%
 %% This function does the same thing as {@link get_env/4}, but also updates the
 %% This function does the same thing as {@link get_env/4}, but also updates the
@@ -942,7 +944,7 @@ update_counter(_, _) ->
 %%
 %%
 %% @doc Atomically transfers the key `From' to the process identified by `To'.
 %% @doc Atomically transfers the key `From' to the process identified by `To'.
 %%
 %%
-%% This function transfers any gproc key (name, property, counter, aggr. counter)
+%% This function transfers any gproc key (name, property, counter, aggr counter)
 %% from one process to another, and returns the pid of the new owner.
 %% from one process to another, and returns the pid of the new owner.
 %%
 %%
 %% `To' must be either a pid or a unique name (name or aggregated counter), but
 %% `To' must be either a pid or a unique name (name or aggregated counter), but
@@ -1434,7 +1436,6 @@ pattern([{Head, Gs, As}], Scope) ->
         {true,_N} ->
         {true,_N} ->
             HeadPat = {{{T,S,'_'},'_'},'_','_'},
             HeadPat = {{{T,S,'_'},'_'},'_','_'},
             Vs = [{Head, obj_prod()}],
             Vs = [{Head, obj_prod()}],
-%%            {HeadPat, Vs} = headpat(Scope, A,B,C),
             %% the headpat function should somehow verify that Head is
             %% the headpat function should somehow verify that Head is
             %% consistent with Scope (or should we add a guard?)
             %% consistent with Scope (or should we add a guard?)
             [{HeadPat, rewrite(Gs, Vs), rewrite(As, Vs)}];
             [{HeadPat, rewrite(Gs, Vs), rewrite(As, Vs)}];
@@ -1678,4 +1679,3 @@ qlc_select({Objects, Cont}) ->
 is_unique(n) -> true;
 is_unique(n) -> true;
 is_unique(a) -> true;
 is_unique(a) -> true;
 is_unique(_) -> false.
 is_unique(_) -> false.
-

+ 11 - 11
src/gproc_dist.erl

@@ -3,18 +3,18 @@
 %% compliance with the License. You should have received a copy of the
 %% compliance with the License. You should have received a copy of the
 %% Erlang Public License along with this software. If not, it can be
 %% Erlang Public License along with this software. If not, it can be
 %% retrieved via the world wide web at http://www.erlang.org/.
 %% retrieved via the world wide web at http://www.erlang.org/.
-%% 
+%%
 %% Software distributed under the License is distributed on an "AS IS"
 %% Software distributed under the License is distributed on an "AS IS"
 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 %% the License for the specific language governing rights and limitations
 %% the License for the specific language governing rights and limitations
 %% under the License.
 %% under the License.
-%% 
+%%
 %% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
 %% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
 %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
 %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
 %% AB. All Rights Reserved.''
 %% AB. All Rights Reserved.''
 %%
 %%
 %% @author Ulf Wiger <ulf.wiger@erlang-solutions.com>
 %% @author Ulf Wiger <ulf.wiger@erlang-solutions.com>
-%% 
+%%
 %% @doc Extended process registry
 %% @doc Extended process registry
 %% <p>This module implements an extended process registry</p>
 %% <p>This module implements an extended process registry</p>
 %% <p>For a detailed description, see gproc/doc/erlang07-wiger.pdf.</p>
 %% <p>For a detailed description, see gproc/doc/erlang07-wiger.pdf.</p>
@@ -137,11 +137,11 @@ update_counter(_, _) ->
 %% This function can be used to ensure that data has been replicated from the
 %% This function can be used to ensure that data has been replicated from the
 %% leader to the current node. It does so by asking the leader to ping all
 %% leader to the current node. It does so by asking the leader to ping all
 %% live participating nodes. The call will return `true' when all these nodes
 %% live participating nodes. The call will return `true' when all these nodes
-%% have either responded or died. In the special case where the leader dies 
+%% have either responded or died. In the special case where the leader dies
 %% during an ongoing sync, the call will fail with a timeout exception.
 %% during an ongoing sync, the call will fail with a timeout exception.
-%% (Actually, it should be a `leader_died' exception; more study needed to find out
-%% why gen_leader times out in this situation, rather than reporting that the 
-%% leader died.)
+%% (Actually, it should be a `leader_died' exception; more study needed to find
+%% out why gen_leader times out in this situation, rather than reporting that
+%% the leader died.)
 %% @end
 %% @end
 %%
 %%
 sync() ->
 sync() ->
@@ -370,8 +370,8 @@ handle_leader_cast({sync_reply, Node, Ref}, S, _E) ->
         false ->
         false ->
             %% This should never happen, except perhaps if the leader who
             %% This should never happen, except perhaps if the leader who
             %% received the sync request died, and the new leader gets the
             %% received the sync request died, and the new leader gets the
-            %% sync reply. In that case, we trust that the client has been notified
-            %% anyway, and ignore the message.
+            %% sync reply. In that case, we trust that the client has been
+	    %% notified anyway, and ignore the message.
             {ok, S};
             {ok, S};
         {_, Ns} ->
         {_, Ns} ->
             case lists:delete(Node, Ns) of
             case lists:delete(Node, Ns) of
@@ -404,7 +404,7 @@ handle_leader_cast({pid_is_DOWN, Pid}, S, _E) ->
     end.
     end.
 
 
 process_globals(Globals) ->
 process_globals(Globals) ->
-    Modified = 
+    Modified =
         lists:foldl(
         lists:foldl(
           fun({{T,_,_} = Key, Pid}, A) ->
           fun({{T,_,_} = Key, Pid}, A) ->
                   A1 = case T of
                   A1 = case T of
@@ -528,7 +528,7 @@ update_aggr_counter({c,g,Ctr}, Incr) ->
             [New]
             [New]
     end.
     end.
 
 
-pid_to_give_away_to(P) when is_pid(P) ->                 
+pid_to_give_away_to(P) when is_pid(P) ->
     P;
     P;
 pid_to_give_away_to({T,g,_} = Key) when T==n; T==a ->
 pid_to_give_away_to({T,g,_} = Key) when T==n; T==a ->
     case ets:lookup(?TAB, {Key, T}) of
     case ets:lookup(?TAB, {Key, T}) of

+ 2 - 1
src/gproc_init.erl

@@ -36,7 +36,8 @@ soft_reset() ->
 hard_reset() ->
 hard_reset() ->
     %% exit normal {n,'_','_'}
     %% exit normal {n,'_','_'}
     _ = [ exit(Pid,normal) || Pid <- gproc:lookup_pids({n,'_','_'}),
     _ = [ exit(Pid,normal) || Pid <- gproc:lookup_pids({n,'_','_'}),
-                              (node(Pid) =/= node()) orelse is_process_alive(Pid) ],
+                              (node(Pid) =/= node())
+                                  orelse is_process_alive(Pid) ],
     %% kill via supervisor
     %% kill via supervisor
     ok = supervisor:terminate_child(gproc_sup, gproc),
     ok = supervisor:terminate_child(gproc_sup, gproc),
     %% delete ets table
     %% delete ets table

+ 1 - 1
src/gproc_sup.erl

@@ -40,7 +40,7 @@ init(_Args) ->
     GProc =
     GProc =
         {gproc, {gproc, start_link, []},
         {gproc, {gproc, start_link, []},
          permanent, 2000, worker, [gproc]},
          permanent, 2000, worker, [gproc]},
-    
+
     Dist = case application:get_env(gproc_dist) of
     Dist = case application:get_env(gproc_dist) of
                undefined -> [];
                undefined -> [];
                {ok, false} -> [];
                {ok, false} -> [];