<div dir="ltr">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<div>
<div><br></div><div style>-Alan</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 14, 2013 at 2:19 AM, 3k4b251 <span dir="ltr">&lt;<a href="mailto:314992959@qq.com" target="_blank">314992959@qq.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ok. �for example.<br>
<br>
this&#39;s �a �thread, we �receive �message from it.<br>
� �msg_receive(LPVOID �lpParameter){<br>
<br>
� � � amqp_connection_state_t �conn = �(amqp_connection_state_t)lpParameter;<br>
<br>
� � � amqp_frame_t � �frame;<br>
<br>
� � � int result;<br>
<br>
� � result = amqp_simple_wait_frame(conn, &amp;frame); � � //block �here<br>
� � �......................... // omit �the process of �receive<br>
� � �........................<br>
}<br>
<br>
void main(){<br>
� � � amqp_connection_state_t �conn �=amqp_new_connection();<br>
� � �............................... �// omit the process of �connect<br>
� � �...............................<br>
� � �// I �start the �thread , �and �it �block �in<br>
amqp_simple_wait_frame();<br>
� � �_beginthread(msg_receive,0,this);<br>
<br>
� � //so �next �i �wan declare �a �queue<br>
� � amqp_queue_declare(conn,......); �//but �i �find �it �block. �so i can&#39;t<br>
do anything �after.<br>
<br>
<br>
�amqp_exchange_declare(); amqp_basic_consume(); have the same �problem too.<br>
I �guess �every �function with �the �parameter �of conn �just block.<br>
<div class="im">what&#39;s �the problem?<br>
<br>
<br>
<br>
}<br>
<br>
<br>
<br>
<br>
<br>
--<br>
</div>View this message in context: <a href="http://rabbitmq.1065348.n5.nabble.com/rabbitmq-c-connection-block-tp27297p27389.html" target="_blank">http://rabbitmq.1065348.n5.nabble.com/rabbitmq-c-connection-block-tp27297p27389.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the RabbitMQ mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br></div>