2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FNet_NetUtility.cpp
19 * @brief This is the implementation file for %_NetUtility class.
21 * This file contains the implementation of %_NetUtility class.
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
28 #include <FBaseRtMutex.h>
29 #include <FBaseSysLog.h>
30 #include "FNet_NetUtility.h"
32 using namespace Tizen::Base;
33 using namespace Tizen::Base::Runtime;
35 namespace Tizen { namespace Net {
37 Mutex* _NetUtility::__pLock = null;
39 _NetUtility::_NetUtility(void)
43 _NetUtility::~_NetUtility(void)
48 _NetUtility::GetLock(void)
50 static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
55 pthread_once(&onceBlock, InitLock);
56 result r = GetLastResult();
59 onceBlock = PTHREAD_ONCE_INIT;
67 _NetUtility::InitLock(void)
72 r = lock.Create(L"NetLock");
73 SysTryReturnVoidResult(NID_NET, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));