Sorry accidentally sent that:

    return pthread_self()

}

Then you register it, and your library should be thread safe.

Again sorry about sending that too soon.  Best of luck!


     -Sam

On Thu, Sep 2, 2010 at 10:36 AM, Sam Jantz <sjan...@gmail.com> wrote:

> Lu,
>
>      I'm not sure specifically about windows, but it seems that you have
> not created the id function.  Once you create the id function then you need
> to register it in the thread_setup with the function
> CRYPTO_set_id_callback(<name of your id function>);  The thread_id function
> is a very small function that just returns the thread id for calling thread.
>  In linux you implement it like this:
>
> static unsigned long id_function(void){
>
> }
>
> On Thu, Sep 2, 2010 at 3:34 AM, Lu zhuiyue <zhuiyue1...@gmail.com> wrote:
>
>> the documentation (http://www.openssl.org/docs/crypto/threads.html) says
>>
>> to use openssl library in multi threds environments,  the user should set
>> thses tow callback functions
>> locking_function and threadid_func
>>
>> the example:
>> *crypto/threads/mttest.c*
>> on win32 platform:
>>
>> it does not set threadid_func. it is an error?
>>
>
>
>
> --
> Sam Jantz
> Software Engineer
>
>


-- 
Sam Jantz
Software Engineer

Reply via email to