OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #endif | 31 #endif |
32 } | 32 } |
33 | 33 |
34 UdpSocketManager* UdpSocketManager::StaticInstance( | 34 UdpSocketManager* UdpSocketManager::StaticInstance( |
35 CountOperation count_operation, | 35 CountOperation count_operation, |
36 const int32_t id, | 36 const int32_t id, |
37 uint8_t& numOfWorkThreads) | 37 uint8_t& numOfWorkThreads) |
38 { | 38 { |
39 UdpSocketManager* impl = | 39 UdpSocketManager* impl = |
40 GetStaticInstance<UdpSocketManager>(count_operation); | 40 GetStaticInstance<UdpSocketManager>(count_operation); |
41 if (count_operation == kAddRef && impl != NULL) { | 41 if (count_operation == kAddRef && impl != nullptr) { |
42 if (impl->Init(id, numOfWorkThreads)) { | 42 if (impl->Init(id, numOfWorkThreads)) { |
43 impl->Start(); | 43 impl->Start(); |
44 } | 44 } |
45 } | 45 } |
46 return impl; | 46 return impl; |
47 } | 47 } |
48 | 48 |
49 UdpSocketManager* UdpSocketManager::Create(const int32_t id, | 49 UdpSocketManager* UdpSocketManager::Create(const int32_t id, |
50 uint8_t& numOfWorkThreads) | 50 uint8_t& numOfWorkThreads) |
51 { | 51 { |
52 return UdpSocketManager::StaticInstance(kAddRef, id, numOfWorkThreads); | 52 return UdpSocketManager::StaticInstance(kAddRef, id, numOfWorkThreads); |
53 } | 53 } |
54 | 54 |
55 void UdpSocketManager::Return() | 55 void UdpSocketManager::Return() |
56 { | 56 { |
57 uint8_t numOfWorkThreads = 0; | 57 uint8_t numOfWorkThreads = 0; |
58 UdpSocketManager::StaticInstance(kRelease, -1, | 58 UdpSocketManager::StaticInstance(kRelease, -1, |
59 numOfWorkThreads); | 59 numOfWorkThreads); |
60 } | 60 } |
61 | 61 |
62 UdpSocketManager::UdpSocketManager() : _numOfWorkThreads(0) | 62 UdpSocketManager::UdpSocketManager() : _numOfWorkThreads(0) |
63 { | 63 { |
64 } | 64 } |
65 | 65 |
66 uint8_t UdpSocketManager::WorkThreads() const | 66 uint8_t UdpSocketManager::WorkThreads() const |
67 { | 67 { |
68 return _numOfWorkThreads; | 68 return _numOfWorkThreads; |
69 } | 69 } |
70 | 70 |
71 } // namespace test | 71 } // namespace test |
72 } // namespace webrtc | 72 } // namespace webrtc |
OLD | NEW |