I need to synchronize this method on id
argument value.
I was thinking about using string pool reference, is there a better way?
static void f(Number id) {
String s = String.valueOf(id).intern();
synchronized (s) {
// syncronize this block by id value
}
}