diff options
| author | Simon MacMullen <simon@lshift.net> | 2010-05-28 15:36:05 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@lshift.net> | 2010-05-28 15:36:05 +0100 |
| commit | c042462589ed769e1db2b2d75cf30ff4981ace56 (patch) | |
| tree | a0326e3a19b4da00e943a0649bea20eaa3c87c55 /src | |
| parent | dbf36558fe3c1fa369b5ffc1988b6cf2089d51b0 (diff) | |
| download | rabbitmq-server-git-c042462589ed769e1db2b2d75cf30ff4981ace56.tar.gz | |
Cherry-pick the queue-exclusivity-on-basic.get thing from amqp_0_9_1.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_channel.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index e915c7b378..f4254aa61a 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -453,11 +453,13 @@ handle_method(#'basic.ack'{delivery_tag = DeliveryTag, handle_method(#'basic.get'{queue = QueueNameBin, no_ack = NoAck}, _, State = #ch{ writer_pid = WriterPid, + reader_pid = ReaderPid, next_tag = DeliveryTag }) -> QueueName = expand_queue_name_shortcut(QueueNameBin, State), check_read_permitted(QueueName, State), - case rabbit_amqqueue:with_or_die( + case with_exclusive_access_or_die( QueueName, + ReaderPid, fun (Q) -> rabbit_amqqueue:basic_get(Q, self(), NoAck) end) of {ok, MessageCount, Msg = {_QName, _QPid, _MsgId, Redelivered, |
