Add multi-thread support

This commit is contained in:
2025-09-06 04:29:50 -07:00
parent 814234603d
commit 97d1b4a701
8 changed files with 277 additions and 151 deletions

View File

@ -1,3 +1,4 @@
#undef NDEBUG
#include "alloc.h"
#include <assert.h>
@ -130,7 +131,6 @@ int main(int argc, const char **argv) {
RefcountWeakref *x = refcount_context_weaken(c, a);
w = refcount_context_make_weakref(c, a);
assert(refcount_context_num_refs(c, a) == 1);
assert(w != x);
refcount_context_destroy_weakref(c, x);
refcount_context_ref(c, a);
@ -138,7 +138,6 @@ int main(int argc, const char **argv) {
x = refcount_context_weaken(c, a);
assert(refcount_context_num_refs(c, a) == 1);
assert(w != x);
assert(refcount_context_weakref_is_valid(c, w));
assert(refcount_context_weakref_is_valid(c, x));