BlackBerry Interlacing

What is the meaning of interlacing in blackberry, why this error occurs

+4
source share
1 answer

Interlaced synchronization is when you have two locks that are synchronized locked in a different order. So, if you have lock a and lock b and do the following:

 synchronized(a) { // Do stuff ... synchronized(b) { // Do stuff ... } } 

And then in another thread:

 synchronized(b) { // Do stuff ... synchronized(a) { // Do stuff ... } } 

It will be interlaced. This situation can lead to a deadlock, so it should be avoided at all costs.

Hope this helps.

+3
source

All Articles