Re: calling __pthread_set_self from a remote_thread
Re: calling __pthread_set_self from a remote_thread
- Subject: Re: calling __pthread_set_self from a remote_thread
- From: Shantonu Sen <email@hidden>
- Date: Tue, 09 Aug 2016 13:06:13 -0700
_pthread_set_self() is not API (hence the underscore prefix), nor is __pthread_set_self(). What documentation are you referring to? Calling either is not supported.
Shantonu
> On Aug 4, 2016, at 4:50 PM, Gordo Cath <email@hidden> wrote:
>
> Hi,
> I find when I call __pthread_set_self from a remote thread in a 64 bit app on osX 10.10 it keeps faulting with an error in pthread_mutex_lock at the time of the crash (using lldb). In the limited documentation I've found, it appears I need to call this function before I can call the dlopen / dlsym calls. Infact if i don't i get a different pthread error which i suspect is for failing to do the first api call. However i digress from the main issue. My guess is that its failing because some other thread has this api locked or some resource locked that the api requires in its use.
>
> Also when I was looking around I saw there are two symbols:
> __pthread_set_self and ___pthread_set_self (one has 2 leading _ and the other has 3 leading _).
> What are the differences between the two functions? I've generally been using the one with 2 leading _, but have tried both and both fail with the same error.
>
> Is it good practice to follow the man page of pthread_mutex_lock and acquire a lock first, then call pthread_set_self? and then after that is finished, then release the lock?
>
> Thanks
>
> Gordo
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden