threads question

Daniel Eischen deischen at freebsd.org
Tue Mar 15 10:19:27 PST 2005


On Tue, 15 Mar 2005, Michael C. Shultz wrote:
>
> Daniel, sorry to bother you again but I ran into something that is
> either a bug or I am missing a vital piece of information somewhere.
> Here is the situation:
>
> 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!
>
>  I remember from assembly days that there were some stack tricks to be
> done when making calls to a shared library in order to pass the
> parameters, I forget what they are (been ages since I did assembly
> programming) but anyways it seems like with gcc passing the args
> through the stack to a function in a shared library isn't being handled
> correctly.  Am I missing something obvious?

I don't know.  You have to be sure that whatever property
points to stays valid for the life of the thread (or at
least as long as it is used).

-- 
DE



More information about the freebsd-hackers mailing list