>this works perfectly because I moved MGPMrUpgrade into
>the same .c file so it would be a static function:                             
>                                           
>                                                                               
>                                               
>structProperty* property;
>pthread_t               threads[NTHREADS];
>pthread_create( &threads[0], NULL, zzMGPMrUpgrade, property );
>When I use MGPMrUpgrade from a shared library the function runs
>yet property isn't being passed!                                               
>                                                
What do you mean by it not being passed? Does your function receive a
NULL value for the parameter instead of the pointer? (Assuming no 
dirty tricks, the function would by definition always be passed *some*
value, though it may be NULL.)

> Hmmm, should I'll try making "property" global then passing a copy of it 
> to each thread?  I think that will guarantee it stays valid.

Since you are asking about makint it global - what is it *now*? It would
have to be either global, dynamically allocated, or on the stack. If it's
on the stack, things are guaranteed to blow up unless the function in
question is guaranteed to not terminate untill all threads are done
with the data. What is the property pointer being initialized/set to?

If it's dynamically allocated you should not have a problem.

And I don't see how static vs. dynamic linking of libraries should matter,
but perhaps I am overlooking something.

-- 
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0xE9758B7D or 'Peter Schuller <[EMAIL PROTECTED]>'
Key retrieval: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://www.scode.org

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to