Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2005 13:19:25 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        "Michael C. Shultz" <ringworm01@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: threads question
Message-ID:  <Pine.GSO.4.43.0503151312090.12075-100000@sea.ntplx.net>
In-Reply-To: <200503150948.01624.ringworm01@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.43.0503151312090.12075-100000>