[rabbitmq-discuss] rabbitmq-c connection block

Alan Antonuk alan.antonuk at gmail.com
Fri Jun 14 17:48:58 BST 2013


The amqp_connection_state_t object is not thread-safe: concurrent use of
the object from multiple threads will result in undefined behavior. You
must synchronize use of the amqp_connection_state_t object in your
application

-Alan


On Fri, Jun 14, 2013 at 2:19 AM, 3k4b251 <314992959 at qq.com> wrote:

> ok.  for example.
>
> this's  a  thread, we  receive  message from it.
>    msg_receive(LPVOID  lpParameter){
>
>       amqp_connection_state_t  conn =
>  (amqp_connection_state_t)lpParameter;
>
>       amqp_frame_t    frame;
>
>       int result;
>
>     result = amqp_simple_wait_frame(conn, &frame);     //block  here
>      ......................... // omit  the process of  receive
>      ........................
> }
>
> void main(){
>       amqp_connection_state_t  conn  =amqp_new_connection();
>      ...............................  // omit the process of  connect
>      ...............................
>      // I  start the  thread ,  and  it  block  in
> amqp_simple_wait_frame();
>      _beginthread(msg_receive,0,this);
>
>     //so  next  i  wan declare  a  queue
>     amqp_queue_declare(conn,......);  //but  i  find  it  block.  so i
> can't
> do anything  after.
>
>
>  amqp_exchange_declare(); amqp_basic_consume(); have the same  problem too.
> I  guess  every  function with  the  parameter  of conn  just block.
> what's  the problem?
>
>
>
> }
>
>
>
>
>
> --
> View this message in context:
> http://rabbitmq.1065348.n5.nabble.com/rabbitmq-c-connection-block-tp27297p27389.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130614/292fe766/attachment.htm>


More information about the rabbitmq-discuss mailing list