We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7c683b commit 062d5a5Copy full SHA for 062d5a5
paddle/fluid/framework/data_type.cc
@@ -28,6 +28,9 @@ struct DataTypeMap {
28
};
29
30
static DataTypeMap* InitDataTypeMap();
31
+// C++11 removes the need for manual locking. Concurrent execution shall wait if
32
+// a static local variable is already being initialized.
33
+// https://stackoverflow.com/questions/11711920/how-to-implement-multithread-safe-singleton-in-c11-without-using-mutex
34
static DataTypeMap& gDataTypeMap() {
35
static DataTypeMap* g_data_type_map_ = InitDataTypeMap();
36
return *g_data_type_map_;
0 commit comments