in reply to Re^2: panic: MUTEX_LOCK (22) - what should I look for? (tools)
in thread panic: MUTEX_LOCK (22) - what should I look for?
I've seen this issue. I certainly don't know all the says this can happen but I saw it this way. I place a lock on a shared variable. It happens to be an array reference. In some operations the locking thread is pushing items onto the array. Others are reading the array and in one case the locking thread is emptying the array. Everything is fine until I attempt the empty the array. I happen to be a huge fan of array references. You will almost never see me use a variable defined as @something or %something. It will nearly always be a scalar holding [] or {}. Old habits die hard so when I want to make the populated array become empty I simple assign [] or in this case &share([]) which is how the exception (fault) is caused. I've not only emptied the object the lock is on I've destroyed it. Once I only emptied and not replaced the array the issue went away so @ $something = (); is the proper way. When it involves sharing and threads.