Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: uwiger/gproc
...
head fork: lemenkov/gproc
Checking mergeability… Don't worry, you can still create the pull request.
  • 8 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 26, 2012
@lemenkov lemenkov Remove explicit rebar deps (Fedora-specific)
This is controlled by RPM in Fedora/EPEL.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
c1b7451
@lemenkov lemenkov Kill useless eunit include
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
e665309
Commits on Jun 01, 2012
@lemenkov lemenkov No such function lists:keyfind/3 in R12B5 - use lists:keysearch/3 ins…
…tead

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
989643f
@lemenkov lemenkov Missing typedefs in R12B
src/gproc_lib.erl:45: type boolean() undefined
src/gproc_lib.erl:171: type reference() undefined

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
c3ad6a0
@lemenkov lemenkov No such built-in function - error/1 in R12B
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
b5fab93
@lemenkov lemenkov No such ETS option in R12B
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2c831f0
@lemenkov lemenkov Fix starting slaves during eunit tests on R12B
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
76f9e8d
@lemenkov lemenkov Can't set up heap_size (R12B-specific)
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
6ad1079
View
5 rebar.config
@@ -1,10 +1,5 @@
%% -*- erlang -*-
{erl_opts, [debug_info]}.
-{deps, [
- {edown, ".*", {git, "git://github.com/esl/edown.git", "HEAD"}},
- {gen_leader, ".*",
- {git, "git://github.com/abecciu/gen_leader_revival.git", "HEAD"}}
- ]}.
{dialyzer_opts, [{warnings, [no_unused,
no_improper_lists, no_fun_app, no_match,
no_opaque, no_fail_call,
View
7 src/gproc.erl
@@ -131,7 +131,6 @@
-include("gproc.hrl").
--include_lib("eunit/include/eunit.hrl").
-define(SERVER, ?MODULE).
%%-define(l, l(?LINE)). % when activated, calls a traceable empty function
@@ -935,7 +934,7 @@ lookup_pids({T,_,_} = Key) ->
[P || P <- L, my_is_process_alive(P)].
-%% @spec (pid()) -> boolean()
+%% @spec (pid()) -> bool()
%%
my_is_process_alive(P) when node(P) =:= node() ->
is_process_alive(P);
@@ -1438,11 +1437,9 @@ pid_to_give_away_to({T,l,_} = Key) when T==n; T==a ->
end.
create_tabs() ->
- Opts = gproc_lib:valid_opts(ets_options, [{write_concurrency,true},
- {read_concurrency, true}]),
case ets:info(?TAB, name) of
undefined ->
- ets:new(?TAB, [ordered_set, public, named_table | Opts]);
+ ets:new(?TAB, [ordered_set, public, named_table]);
_ ->
ok
end.
View
4 src/gproc_dist.erl
@@ -367,14 +367,14 @@ handle_leader_call(_, _, S, _E) ->
handle_leader_cast({sync_reply, Node, Ref}, S, _E) ->
#state{sync_requests = SReqs} = S,
- case lists:keyfind(Ref, 1, SReqs) of
+ case lists:keysearch(Ref, 1, SReqs) of
false ->
%% This should never happen, except perhaps if the leader who
%% 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.
{ok, S};
- {_, Ns} ->
+ {value, {_, Ns}} ->
case lists:delete(Node, Ns) of
[] ->
gen_leader:reply(Ref, {leader, reply, true}),
View
6 src/gproc_lib.erl
@@ -42,7 +42,7 @@
%% Pid around as payload as well. This is a bit redundant, but
%% symmetric.
%%
--spec insert_reg(key(), any(), pid(), scope()) -> boolean().
+-spec insert_reg(key(), any(), pid(), scope()) -> bool().
insert_reg({T,_,Name} = K, Value, Pid, Scope) when T==a; T==n ->
MaybeScan = fun() ->
@@ -168,7 +168,7 @@ maybe_waiters(K, Pid, Value, T, Info) ->
end.
--spec notify_waiters([{pid(), reference()}], key(), pid(), any()) -> ok.
+-spec notify_waiters([{pid(), term()}], key(), pid(), any()) -> ok.
notify_waiters(Waiters, K, Pid, V) ->
_ = [begin
@@ -287,8 +287,6 @@ check_opts(Type, Other) ->
check_option_f(ets_options) -> fun check_ets_option/1;
check_option_f(server_options) -> fun check_server_option/1.
-check_ets_option({read_concurrency , B}) -> is_boolean(B);
-check_ets_option({write_concurrency, B}) -> is_boolean(B);
check_ets_option(_) -> false.
check_server_option({priority, P}) ->
View
2  test/gproc_dist_tests.erl
@@ -294,7 +294,7 @@ start_slave(Name) ->
case node() of
nonode@nohost ->
os:cmd("epmd -daemon"),
- {ok, _} = net_kernel:start([gproc_master, shortnames]);
+ {ok, _} = net_kernel:start([gproc_master]);
_ ->
ok
end,
View
18 test/gproc_tests.erl
@@ -30,30 +30,22 @@ conf_test_() ->
fun(_) ->
application:stop(gproc)
end,
- [?_test(t_server_opts()),
- ?_test(t_ets_opts())]}.
-
-t_server_opts() ->
- H = 10000,
- application:set_env(gproc, server_options, [{min_heap_size, H}]),
- ?assert(ok == application:start(gproc)),
- {min_heap_size, H1} = process_info(whereis(gproc), min_heap_size),
- ?assert(is_integer(H1) andalso H1 > H).
+ [?_test(t_ets_opts())]}.
t_ets_opts() ->
%% Cannot inspect the write_concurrency attribute on an ets table in
%% any easy way, so trace on the ets:new/2 call and check the arguments.
- application:set_env(gproc, ets_options, [{write_concurrency, false}]),
+ application:set_env(gproc, ets_options, []),
erlang:trace_pattern({ets,new, 2}, [{[gproc,'_'],[],[]}], [global]),
erlang:trace(new, true, [call]),
?assert(ok == application:start(gproc)),
erlang:trace(new, false, [call]),
receive
{trace,_,call,{ets,new,[gproc,Opts]}} ->
- ?assertMatch({write_concurrency, false},
- lists:keyfind(write_concurrency,1,Opts))
+ ?assertMatch(false,
+ lists:keysearch(write_concurrency,1,Opts))
after 3000 ->
- error(timeout)
+ erlang:error(timeout)
end.

No commit comments for this range

Something went wrong with that request. Please try again.