summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Schmolck <alexander@lshift.net>2010-01-13 15:15:39 +0000
committerAlexander Schmolck <alexander@lshift.net>2010-01-13 15:15:39 +0000
commita9433b4bb71c81c579e6b3222603bcea529917f4 (patch)
tree5bf2c4e6fd186856fd1c9e889c3d8b80184b4154 /src
parent4e6dfcb1256cdab73233df88dba1aad543e71095 (diff)
downloadrabbitmq-server-git-a9433b4bb71c81c579e6b3222603bcea529917f4.tar.gz
bug22209: added a comment to use upmap carefully.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_misc.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 21764fce6d..d927bfb1f9 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -97,7 +97,7 @@
-spec(enable_cover/1 :: (string()) -> ok_or_error()).
-spec(report_cover/1 :: (string()) -> 'ok').
-spec(throw_on_error/2 ::
- (atom(), thunk({error, any()} | {ok, A} | A)) -> A).
+ (atom(), thunk({error, any()} | {ok, A} | A)) -> A).
-spec(with_exit_handler/2 :: (thunk(A), thunk(A)) -> A).
-spec(filter_exit_map/2 :: (fun ((A) -> B), [A]) -> [B]).
-spec(with_user/2 :: (username(), thunk(A)) -> A).
@@ -339,6 +339,9 @@ intersperse(Sep, [E|T]) -> [E, Sep | intersperse(Sep, T)].
%% This is a modified version of Luke Gorrie's pmap -
%% http://lukego.livejournal.com/6753.html - that doesn't care about
%% the order in which results are received.
+%%
+%% WARNING: This is is deliberately lightweight rather than robust -- if F
+%% throws, upmap will hang forever, so make sure F doesn't throw!
upmap(F, L) ->
Parent = self(),
Ref = make_ref(),
@@ -427,7 +430,7 @@ append_file(File, _, Suffix) ->
ensure_parent_dirs_exist(Filename) ->
case filelib:ensure_dir(Filename) of
ok -> ok;
- {error, Reason} ->
+ {error, Reason} ->
throw({error, {cannot_create_parent_dirs, Filename, Reason}})
end.