diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-13 10:32:02 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-13 10:32:02 +0100 |
commit | 0902083d9e9b39ecbaf9c38a5c2861bcd54faa07 (patch) | |
tree | b405c69fe0dce8f03d298c665bd5967ef6a0029b | |
parent | f9d2b2387e82170bb19e58df1e425942c1d240eb (diff) | |
download | rabbitmq-server-0902083d9e9b39ecbaf9c38a5c2861bcd54faa07.tar.gz |
revert changes to worker_pool
-rw-r--r-- | src/worker_pool.erl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/worker_pool.erl b/src/worker_pool.erl index af5e2896..e4f260cc 100644 --- a/src/worker_pool.erl +++ b/src/worker_pool.erl @@ -59,12 +59,10 @@ start_link() -> [{timeout, infinity}]). submit(Fun) -> - %% If the worker_pool is not running, just run the Fun in the - %% current process. - case get(worker_pool_worker) =:= true orelse whereis(?SERVER) =:= undefined of - true -> worker_pool_worker:run(Fun); - false -> Pid = gen_server2:call(?SERVER, next_free, infinity), - worker_pool_worker:submit(Pid, Fun) + case get(worker_pool_worker) of + true -> worker_pool_worker:run(Fun); + _ -> Pid = gen_server2:call(?SERVER, next_free, infinity), + worker_pool_worker:submit(Pid, Fun) end. submit_async(Fun) -> |