Remove unused pkg dependancy
[platform/upstream/iotivity.git] / resource / csdk / connectivity / common / src / camutex_noop.c
1 //******************************************************************
2 //
3 // Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // 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, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20 //
21 //
22 //*********************************************************************
23
24 /**
25  * @file
26  * This file provides APIs related to mutex with no operation
27  * for Singlethread implementation.
28  */
29
30 #include "camutex.h"
31
32 /**
33  * TAG
34  * Logging tag for module name
35  */
36 #define TAG "UMUTEX"
37
38 typedef struct _tagMutexInfo_t
39 {
40 #if defined(_MSC_VER)
41     uint8_t unused; //VS doesnt like empty structs
42 #endif
43 } ca_mutex_internal;
44
45 typedef struct _tagEventInfo_t
46 {
47 #if defined(_MSC_VER)
48     uint8_t unused; //VS doesnt like empty structs
49 #endif
50 } ca_cond_internal;
51
52 /**
53  * @var g_mutexInfo
54  * @brief This is used to return a non NULL value for ca_mutex_new().
55  */
56 static ca_mutex_internal g_mutexInfo = { 0 };
57
58 /**
59  * @var g_condInfo
60  * @brief This is used to return a non NULL value for ca_cond_new().
61  */
62 static ca_cond_internal g_condInfo = { 0 };
63
64 ca_mutex ca_mutex_new(void)
65 {
66     return (ca_mutex)&g_mutexInfo;
67 }
68
69 bool ca_mutex_free(ca_mutex mutex)
70 {
71     return true;
72 }
73
74 void ca_mutex_lock(ca_mutex mutex)
75 {
76     return;
77 }
78
79 void ca_mutex_unlock(ca_mutex mutex)
80 {
81     return;
82 }
83
84 ca_cond ca_cond_new(void)
85 {
86     return (ca_cond)&g_condInfo;
87 }
88
89 void ca_cond_free(ca_cond cond)
90 {
91     return;
92 }
93
94 void ca_cond_signal(ca_cond cond)
95 {
96     return;
97 }
98
99 void ca_cond_broadcast(ca_cond cond)
100 {
101     return;
102 }
103
104 void ca_cond_wait(ca_cond cond, ca_mutex mutex)
105 {
106     return;
107 }
108
109 CAWaitResult_t ca_cond_wait_for(ca_cond cond, ca_mutex mutex, uint64_t microseconds)
110 {
111     return CA_WAIT_SUCCESS;
112 }
113