Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » al_emit_user_event() thread safe?

Credits go to Edgar Reynaldo and Vanneto for helping out!
This thread is locked; no one can reply to it. rss feed Print
al_emit_user_event() thread safe?
Mark Oates
Member #1,146
March 2001
avatar

I want to call al_emit_user_event() 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 all instances :-/ of the event_queue to prevent problems?

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Vanneto
Member #8,643
May 2007

al_emit_user_event() calls _al_event_source_lock before emitting the event, implemented here. So basically, what Edgar said.

In capitalist America bank robs you.

Mark Oates
Member #1,146
March 2001
avatar

Awesome, thanks guys :)

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Go to: