libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
Loading...
Searching...
No Matches
thread.c
1
/*
2
* CDDL HEADER START
3
*
4
* This file and its contents are supplied under the terms of the
5
* Common Development and Distribution License ("CDDL"), version 1.0.
6
* You may only use this file in accordance with the terms of version
7
* 1.0 of the CDDL.
8
*
9
* A full copy of the text of the CDDL should have accompanied this
10
* source. A copy of the CDDL is also available via the Internet at
11
* http://www.illumos.org/license/CDDL.
12
*
13
* CDDL HEADER END
14
*/
15
/*
16
* Copyright 2021 Saso Kiselkov. All rights reserved.
17
*/
18
19
#include "
acfutils/thread.h
"
20
21
bool_t lacf_thread_list_inited = B_FALSE;
22
mutex_t
lacf_thread_list_lock;
23
list_t
lacf_thread_list;
24
25
#if IBM
26
27
DWORD
28
lacf_thread_start_routine
(
void
*arg)
29
{
30
lacf_thread_info_t
*ti = (
lacf_thread_info_t
*)arg;
31
ti->proc(ti->arg);
32
_lacf_thread_list_remove
(ti);
33
free(ti);
34
return
(0);
35
}
36
37
#else
38
39
void
*
40
lacf_thread_start_routine
(
void
*arg)
41
{
42
lacf_thread_info_t
*ti = (
lacf_thread_info_t
*)arg;
43
ti->proc(ti->arg);
44
_lacf_thread_list_remove
(ti);
45
free(ti);
46
return
(NULL);
47
}
48
49
#endif
lacf_thread_info_t
Definition
thread.h:171
list_t
mutex_t
Definition
thread.h:413
thread.h
lacf_thread_start_routine
DWORD lacf_thread_start_routine(void *arg)
Definition
thread.c:40
_lacf_thread_list_remove
static void _lacf_thread_list_remove(lacf_thread_info_t *ti)
Definition
thread.h:624
Generated by
1.9.8