Home > pthread cond wait error > pthread_cond_wait error code 22

Pthread_cond_wait Error Code 22

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us

Pthread_cond_timedwait Return Value

Learn more about Stack Overflow the company Business Learn more about hiring developers pthread_cond_timedwait example or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack einval Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up pthread_mutex_lock returns invalid argument up vote 4 down

Pthread_mutex_init

vote favorite I am working on some C code and am having a problem with locking a mutex. The code does a call to a function and this function locks a mutex to ensure a file pointer doesn't get overwritten, this works fine for several instances, probably about 10-20 separate calls of the function being called, but on the next call, pthread_mutex_lock will return with a result of 22. I've then put this result into strerror(); and got back invalid argument. What does invalid argument means, thanks for any help you can provide. c debugging pthreads mutex share|improve this question edited Oct 8 '12 at 12:43 vy32 9,0311661128 asked Oct 8 '12 at 12:39 Boardy 9,90554168284 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted Sounds like you have a threading problem or a wild point somewhere else in your program. Try printing the value of the mutex pointer. Try having another thread that simply locks the mutex and then prints to a log file the time and that the lock was successful, then unlocks the mutex. I suspect the problem is not where you are looking. Also, as other have said here, your best bet is to create a very small test program that demonstrates the problem and post it here. Chances are you won't be able to get that small program to demonstrate the error. Then slowly add all of your original code into the small program until the error returns. If it returns, you now know what caused the problem. If it doesn't return, you're done.

and ensure that your hosting provider's database server is running. For more help, see the handbook, or contact your hosting provider.The mysqli error was: Too many connections.

 

Related content

No related pages.