Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » allegro5 threads

This thread is locked; no one can reply to it. rss feed Print
allegro5 threads
Matthew Leverton
Supreme Loser
January 1999
avatar

Threading questions:

  • Why does the thread proc return a value? (e.g. NULL)

  • How do you deal with a thread that you don't care when it finishes? So you create the thread, start it, and go on with your life. Must the thread creator destroy the thread at some point, or can the thread destroy itself within its function before it exits?

Peter Wang
Member #23
April 2000

Quote:

  • Why does the thread proc return a value? (e.g. NULL)

It follows the pthread design. You can return whatever you like, and retrieve the value with al_join_thread().

Quote:

How do you deal with a thread that you don't care when it finishes? So you create the thread, start it, and go on with your life. Must the thread creator destroy the thread at some pont, or can the thread destroy itself within its function before it exits?

You can't do that (yet). The internal API from which the public API evolved never had that ability, because Allegro never needed that itself. It's probably not that hard to add.

Go to: