Fun
0.41.5
The programming language that makes You have fun
Main Page
Data Structures
Files
File List
Globals
Loading...
Searching...
No Matches
src
vm
os
thread_join.c
Go to the documentation of this file.
1
/*
2
* This file is part of the Fun programming language.
3
* https://fun-lang.xyz/
4
*
5
* Copyright 2025 Johannes Findeisen <you@hanez.org>
6
* Licensed under the terms of the Apache-2.0 license.
7
* https://opensource.org/license/apache-2-0
8
*/
9
21
22
case
OP_THREAD_JOIN
: {
23
Value
vtid = pop_value(vm);
24
if
(vtid.
type
!=
VAL_INT
) {
25
fprintf
(stderr,
"Runtime type error: thread_join expects thread id (int)\n"
);
26
push_value
(vm,
make_nil
());
27
free_value
(vtid);
28
break
;
29
}
30
Value
res
= fun_thread_join((
int
)vtid.
i
);
31
free_value
(vtid);
32
push_value
(vm,
res
);
/* takes ownership */
33
break
;
34
}
res
int res
Definition
and.c:34
OP_THREAD_JOIN
@ OP_THREAD_JOIN
Definition
bytecode.h:152
Value
Tagged union representing a Fun value.
Definition
value.h:68
Value::i
int64_t i
Definition
value.h:71
Value::type
ValueType type
Definition
value.h:69
free_value
free_value(vtid)
push_value
push_value(vm, res)
make_nil
Value make_nil(void)
Construct a nil Value.
Definition
value.c:126
VAL_INT
@ VAL_INT
Definition
value.h:51
fprintf
#define fprintf
Definition
vm.c:200
Generated on
for Fun by
1.16.1