From: Jarek C. <jar...@po...> - 2012-05-29 11:12:05
|
W dniu 2012-05-29 11:51, Matthieu Casanova pisze: > > It is only possible if requiring write locks, not read locks. > For example > 1. T1 aquires A write lock, T2 aquires B write lock > 2. T1 wants B read (or write) lock T2 wants A read (or write) lock. Right, I forgot about readLocks, that they don't block one another. So the situation becomes quite unlikely. We may not consider it until it happens. Then the ordering of buffers may be handy. > > I think that a write lock must only be aquired in EDT thread (that > would be logical since Swing requires that any change that could > modify the display must be done in the EDT thread). > In that case it would solve the problem don't you think ? Buffer is not AWT component, so Swing rules do not affect it. This constraint would be too strict, because search and replace probably does it outside EDT and that's ok. Jarek |