xref: /aoo42x/main/extensions/source/ole/ole2uno.cxx (revision 2a97ec55)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 // MARKER(update_precomp.py): autogen include statement, do not remove
26 #include "precompiled_extensions.hxx"
27 #include "osl/getglobalmutex.hxx"
28 #include "rtl/instance.hxx"
29 #include "ole2uno.hxx"
30 
31 using namespace osl;
32 namespace ole_adapter
33 {
34 
35 struct MutexInit
36 {
operator ()ole_adapter::MutexInit37     Mutex * operator () ()
38     {
39         static Mutex aInstance;
40         return &aInstance;
41     }
42 };
43 
44 
getBridgeMutex()45 Mutex * getBridgeMutex()
46 {
47     return rtl_Instance< Mutex, MutexInit, ::osl::MutexGuard,
48         ::osl::GetGlobalMutex >::create(
49             MutexInit(), ::osl::GetGlobalMutex());
50 }
51 
52 
53 // Mutex* getBridgeMutex()
54 // {
55 // 	static Mutex* pMutex= NULL;
56 
57 // 	if( ! pMutex)
58 // 	{
59 // 		MutexGuard guard( Mutex::getGlobalMutex() );
60 // 		if( !pMutex)
61 // 		{
62 // 			static Mutex aMutex;
63 // 			pMutex= &aMutex;
64 // 		}
65 // 	}
66 // 	return pMutex;
67 // }
68 
69 }
70