[PD-dev] How to pass indeterminate args to a thread
matju at artengine.ca
Sat Feb 28 00:01:50 CET 2009
On Fri, 27 Feb 2009, Martin Peach wrote:
> You called pthread_create() with &threadargs:
> ret = pthread_create( &thread1, NULL, mythread, &threadArgs);
> when you probably should just use threadargs, since it's already a pointer.
> Or else you need to dereference the handle:
> post("My symbol: %s",
> ((*(struct floatArgStruct**))threadArgs)->s->s_name);
No, it was supposed to be just threadArgs, but the type of threadArgs
changed while writing the code, as I made him change it from a global
variable to a malloc. In the end, it turns out it wasn't quite useful,
because there's only going to be one extra thread, after all.
_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
More information about the Pd-dev