forked from analogdevicesinc/libiio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lock-dummy.c
80 lines (62 loc) · 1.28 KB
/
lock-dummy.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// SPDX-License-Identifier: LGPL-2.1-or-later
/*
* libiio - Library for interfacing industrial I/O (IIO) devices
*
* Copyright (C) 2024 Analog Devices, Inc.
* Author: Paul Cercueil <[email protected]>
*/
#include <iio/iio.h>
#include <iio/iio-lock.h>
#include <errno.h>
#include <stdlib.h>
struct iio_mutex {
int dummy; /* Flawfinder: ignore */
};
struct iio_cond {
int dummy; /* Flawfinder: ignore */
};
struct iio_mutex * iio_mutex_create(void)
{
struct iio_mutex *lock = malloc(sizeof(*lock));
if (!lock)
return iio_ptr(-ENOMEM);
return lock;
}
void iio_mutex_destroy(struct iio_mutex *lock)
{
free(lock);
}
void iio_mutex_lock(struct iio_mutex *lock)
{
}
void iio_mutex_unlock(struct iio_mutex *lock)
{
}
struct iio_cond * iio_cond_create(void)
{
struct iio_cond *cond = malloc(sizeof(*cond));
if (!cond)
return iio_ptr(-ENOMEM);
return cond;
}
void iio_cond_destroy(struct iio_cond *cond)
{
free(cond);
}
int iio_cond_wait(struct iio_cond *cond, struct iio_mutex *lock,
unsigned int timeout_ms)
{
return -ETIMEDOUT;
}
void iio_cond_signal(struct iio_cond *cond)
{
}
struct iio_thrd * iio_thrd_create(int (*thrd)(void *),
void *d, const char *name)
{
return iio_ptr(-ENOSYS);
}
int iio_thrd_join_and_destroy(struct iio_thrd *thrd)
{
return 0;
}