calling __pthread_set_self from a remote_thread
calling __pthread_set_self from a remote_thread
- Subject: calling __pthread_set_self from a remote_thread
- From: Gordo Cath <email@hidden>
- Date: Thu, 04 Aug 2016 19:50:18 -0400
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