-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrilthreads.c
More file actions
56 lines (45 loc) · 1.04 KB
/
Copy pathrilthreads.c
File metadata and controls
56 lines (45 loc) · 1.04 KB
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
#define LOG_NDEBUG 0
#define LOG_TAG "RILWrapThread"
#include <errno.h>
#include <pthread.h>
#include <unistd.h>
#include <telephony/ril.h>
#include <utils/Log.h>
#include "rilthreads.h"
#include "multicast.h"
void RIL_startThreads(void *param1, void *param2)
{
int ret;
pthread_attr_t attr;
pthread_t tid_android, tid_radio;
pthread_attr_init (&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ret = pthread_create(&tid_radio, &attr, RIL_radioThread, param1);
if (ret < 0) {
LOGE("Failed to create radio thread errno:%d", errno);
return;
}
ret = pthread_create(&tid_android, &attr, RIL_androidThread, param2);
if (ret < 0) {
LOGE("Failed to create android thread errno:%d", errno);
return;
}
}
void *RIL_radioThread(void *param)
{
RIL_RadioFunctions *functions = (RIL_RadioFunctions*) param;
while(1) {
/* TODO: Do something */
sleep(1);
}
return NULL;
}
void *RIL_androidThread(void *param)
{
struct RIL_Env *env = (struct RIL_Env*) param;
while(1) {
/* TODO: Do something */
sleep(1);
}
return NULL;
}