#How to error handle pthread functions? (thats not pthread_create)

6 messages · Page 1 of 1 (latest)

versed pilotBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

paper nebula
#

I'd recommend looking at their man pages. They describe what the return value will be upon error and which errors they can return

#

I don't typically see locking and unlocking handled, since there's not really anything you can do at that point

#

I mean, you could elide running any of your code if pthread_mutex_lock isn't zero. Looks like pthread_mutex_unlock won't fail unless you don't own the mutex, so that shouldn't happen if lock succeeded

paper nebula
#

I would definitely check initialization

versed pilotBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity