[concurrency-interest] Creating custom locks

David Holmes dholmes@dltech.com.au
Thu, 20 Nov 2003 13:35:03 +1000


>     final void checkOwner(Thread t) { //why final
>         if (owner != t)
>             throw new IllegalMonitorStateException();
>     }
> }

Why would you want to override this? It is a simple little helper
function. Is final really the problem here or the lack of access? I
have no problem with making this protected, but I wouldn't want anyone
to override this to not check ownership, for example.

David Holmes