Mistake on this page? Email us
edge_mutex.h
Go to the documentation of this file.
1 /*
2  * ----------------------------------------------------------------------------
3  * Copyright 2018 ARM Ltd.
4  *
5  * SPDX-License-Identifier: Apache-2.0
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 #ifndef EDGE_MUTEX_H
21 #define EDGE_MUTEX_H
22 
23 #include <pthread.h>
24 #include <stdint.h>
25 
43 typedef pthread_mutex_t edge_mutex_t;
44 
56 int32_t edge_mutex_init(edge_mutex_t *mutex, int32_t type);
57 
62 int32_t edge_mutex_destroy(edge_mutex_t *mutex);
63 
68 int32_t edge_mutex_lock(edge_mutex_t *mutex);
69 
74 int32_t edge_mutex_unlock(edge_mutex_t *mutex);
75 
81 #endif
int32_t edge_mutex_lock(edge_mutex_t *mutex)
Locks the mutex.
int32_t edge_mutex_destroy(edge_mutex_t *mutex)
Destroys a mutex. The user is responsible to deallocate the memory for the mutex structure.
int32_t edge_mutex_init(edge_mutex_t *mutex, int32_t type)
Initializes a mutex.
int32_t edge_mutex_unlock(edge_mutex_t *mutex)
Unlocks the mutex.