<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>al_emit_user_event() thread safe?</title>
		<link>http://www.allegro.cc/forums/view/615881</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 18 Nov 2015 23:08:09 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I want to call <span class="source-code"><a href="http://www.allegro.cc/manual/al_emit_user_event"><span class="a">al_emit_user_event</span></a><span class="k2">(</span><span class="k2">)</span></span> from a separate thread on an event queue that is being used elsewhere in the program.  Is that ok?  Do I need to mutex lock <i>all instances</i> <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> of the event_queue to prevent problems?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Wed, 18 Nov 2015 13:59:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I may be wrong, but I think the event queues are thread safe. I think they have internal locking mechanisms.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 18 Nov 2015 15:04:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="https://github.com/liballeg/allegro5/blob/5.1/src/evtsrc.c#L236">al_emit_user_event()</a> calls <span class="source-code">_al_event_source_lock</span> before emitting the event, implemented <a href="https://github.com/liballeg/allegro5/blob/5.1/src/evtsrc.c#L75">here</a>. So basically, what Edgar said.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Wed, 18 Nov 2015 16:58:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Awesome, thanks guys <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Wed, 18 Nov 2015 23:08:09 +0000</pubDate>
	</item>
</rss>
