From 9a4765a62e321af08ec96a03cdbef64039788e86 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 14 May 2013 19:35:54 -0500 Subject: Automated update from Qt3 --- src/moc/moc.y | 5 ++++- src/moc/moc_yacc.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/moc') diff --git a/src/moc/moc.y b/src/moc/moc.y index faa4c5243..4540262be 100644 --- a/src/moc/moc.y +++ b/src/moc/moc.y @@ -2986,7 +2986,9 @@ void generateClass() // generate C++ source code for a class // Generate staticMetaObject member function // fprintf( out, "TQMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() ); - fprintf( out, " if ( metaObj )\n\treturn metaObj;\n" ); + fprintf( out, " if ( metaObj ) {\n\treturn metaObj;\n}\n" ); + fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();\n" ); + fprintf( out, " if ( metaObj ) {\n\tif (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();\n\treturn metaObj;\n }\n#endif // QT_THREAD_SUPPORT\n" ); if ( isTQObject ) fprintf( out, " TQMetaObject* parentObject = staticTQtMetaObject();\n" ); else if ( !g->superClassName.isEmpty() ) @@ -3056,6 +3058,7 @@ void generateClass() // generate C++ source code for a class // Setup cleanup handler and return meta object // fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() ); + fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();\n#endif // QT_THREAD_SUPPORT\n" ); fprintf( out, " return metaObj;\n}\n" ); // diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp index 8f655dade..13c38b654 100644 --- a/src/moc/moc_yacc.cpp +++ b/src/moc/moc_yacc.cpp @@ -5812,7 +5812,9 @@ void generateClass() // generate C++ source code for a class // Generate staticMetaObject member function // fprintf( out, "TQMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() ); - fprintf( out, " if ( metaObj )\n\treturn metaObj;\n" ); + fprintf( out, " if ( metaObj ) {\n\treturn metaObj;\n}\n" ); + fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();\n" ); + fprintf( out, " if ( metaObj ) {\n\tif (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();\n\treturn metaObj;\n }\n#endif // QT_THREAD_SUPPORT\n" ); if ( isTQObject ) fprintf( out, " TQMetaObject* parentObject = staticTQtMetaObject();\n" ); else if ( !g->superClassName.isEmpty() ) @@ -5882,6 +5884,7 @@ void generateClass() // generate C++ source code for a class // Setup cleanup handler and return meta object // fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() ); + fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();\n#endif // QT_THREAD_SUPPORT\n" ); fprintf( out, " return metaObj;\n}\n" ); // -- cgit v1.2.1