Subject: Re: [linux-audio-dev] basic help needed with programming threads
From: Dave Phillips (dlphilp_AT_bright.net)
Date: Thu May 03 2001 - 16:13:17 EEST
Paul Davis wrote:
> this should get you started:
>
> pthread_t thread_handle;
> void *fltkRun (void *arg);
>
> extern "C" void FL_run (FLRUN *p)
> {
> #ifdef WINDOWS
> #warning blech
> #endif
>
> #ifdef LINUX
> if (pthread_create (&threadHandle, 0, fltkRun, p)) {
> ... error ... thread not created ...
> }
> #endif
> }
Curiously, that didn't work. This did:
#ifdef LINUX
pthread_t thread1;
threadHandle = pthread_create(&thread1, 0, (void *)fltkRun, (void
*)NULL);
#endif
But I know not what I do. I basically copied some example code from the
net, plugged it in, and voila, it works. That's mojo, not programming,
so I'd like to know some why's and wherefore's.
Any comments ? I'm a total novice at threads, I'm studying some tutorial
material on the net, but I don't understand why Paul's suggested code
didn't work.
Best regards,
== Dave Phillips
The Book Of Linux Music & Sound at http://www.nostarch.com/lms.htm
The Linux Soundapps Site at http://sound.condorow.net
This archive was generated by hypermail 2b28 : Thu May 03 2001 - 16:47:53 EEST