我有以下代码:
public Hashmap<String,String> tempmap = new HashMap<String,String>();
和一个类函数:
void f1(){
    synchronized(onClassVariable1){
    ....Some code onClassVariable1...
    String tempString = tempMap.toString();
    ... Some work onClassVarible1 and tempString ...
    }
  }
多个线程通过这个类的一个对象调用这个函数 f1 ..
这个函数是线程安全的吗??