Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: erlang
otp_release:
- 21.0.2
- 20.3
- 19.3
- 18.3
- 17.4
- 17.3
- 17.1
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{profiles, [
{test, [
{plugins, [
{rebar3_eqc, ".*", {git, "https://github.com/kellymclaughlin/rebar3-eqc-plugin.git", {tag, "0.0.8"}}}
{rebar3_eqc, ".*", {git, "https://github.com/kellymclaughlin/rebar3-eqc-plugin.git", {tag, "0.1.0"}}}
]}
]
}]}.
1 change: 1 addition & 0 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[].
12 changes: 10 additions & 2 deletions src/poolboy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
-type pid_queue() :: queue:queue().
-endif.

-ifdef(OTP_RELEASE). %% this implies 21 or higher
-define(EXCEPTION(Class, Reason, Stacktrace), Class:Reason:Stacktrace).
-define(GET_STACK(Stacktrace), Stacktrace).
-else.
-define(EXCEPTION(Class, Reason, _), Class:Reason).
-define(GET_STACK(_), erlang:get_stacktrace()).
-endif.

-type pool() ::
Name :: (atom() | pid()) |
{Name :: atom(), node()} |
Expand Down Expand Up @@ -54,9 +62,9 @@ checkout(Pool, Block, Timeout) ->
try
gen_server:call(Pool, {checkout, CRef, Block}, Timeout)
catch
Class:Reason ->
?EXCEPTION(Class, Reason, Stacktrace) ->
gen_server:cast(Pool, {cancel_waiting, CRef}),
erlang:raise(Class, Reason, erlang:get_stacktrace())
erlang:raise(Class, Reason, ?GET_STACK(Stacktrace))
end.

-spec checkin(Pool :: pool(), Worker :: pid()) -> ok.
Expand Down
2 changes: 1 addition & 1 deletion test/poolboy_eqc.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-module(poolboy_eqc).
-compile([export_all]).
-compile([export_all, nowarn_export_all]).

-ifdef(TEST).
-ifdef(EQC).
Expand Down
2 changes: 1 addition & 1 deletion test/poolboy_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ reuses_waiting_monitor_on_worker_exit() ->
receive ok -> ok end
end),

Worker = receive {worker, Worker} -> Worker end,
Worker = receive {worker, Worker1} -> Worker1 end,
Ref = monitor(process, Worker),
exit(Worker, kill),
receive
Expand Down