Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
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
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}
int res
Definition and.c:34
@ OP_THREAD_JOIN
Definition bytecode.h:152
Tagged union representing a Fun value.
Definition value.h:68
int64_t i
Definition value.h:71
ValueType type
Definition value.h:69
free_value(vtid)
push_value(vm, res)
Value make_nil(void)
Construct a nil Value.
Definition value.c:126
@ VAL_INT
Definition value.h:51
#define fprintf
Definition vm.c:200