What could be the reason for the "event with long-term monitoring of the monitor using the owner method"?

I'm starting, and I have the task of creating a basic application for chatting two clients and a server exchanging strings that are the destination address +.

I wrote some code, but when I use it, I get this “long-running monitor competition event using the owner method” on the other end.

Can someone help me on how this can happen? Or can someone tell me the reason for this at all?

+7
java android
source share
1 answer

This is because one thread holds the monitor / mutex for a long time and blocks other threads. In this case, the “long time” is 100 milliseconds or more. ( This transfer request contains this checkmark.)

This is a warning ... but you will be asked to look into it, as this may lead to your application being unresponsive.

In general, the treatment is to reduce the time that your application must contain mutexes. But without seeing your code, it's hard to advise how you do it.

+13
source share

All Articles