Pthread mutex assertion error

前端 未结 7 941
渐次进展
渐次进展 2020-12-24 05:50

I\'m encountering the following error at unpredictable times in a linux-based (arm) communications application:

pthread_mutex_lock.c:82: __pthread_mutex_lock         


        
7条回答
  •  一个人的身影
    2020-12-24 06:12

    I was faced with the same problem and google sent me here. The problem with my program was that in some situations I was not initializing the mutex before locking it.

    Although the statement in the accepted answer is legitimate, I think it is not the cause of this failed assertion. Because the error is reported on pthread_mutex_lock (and not unlock).

    Also, as always, it is more likely that the error is in the programmers source code rather than the compiler.

提交回复
热议问题