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 | 2f0671399ad240d154e73d4d51e6c6928c580be0 (patch) | |
| tree | b405c69fe0dce8f03d298c665bd5967ef6a0029b | |
| parent | 656f08429af0c678ae057fb598384045ff359fae (diff) | |
| download | rabbitmq-server-git-2f0671399ad240d154e73d4d51e6c6928c580be0.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 af5e289688..e4f260cc50 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) -> |
