replace extra gen parameters in artifact creation hook; replace with explicit cancellation signal, passed by caller

This commit is contained in:
Ryan Fleury
2025-09-30 11:01:04 -07:00
parent 45a2137d08
commit bf27344a9b
13 changed files with 170 additions and 33 deletions
+8 -2
View File
@@ -16,7 +16,7 @@ struct AC_Artifact
////////////////////////////////
//~ rjf: Artifact Computation Function Types
typedef AC_Artifact AC_CreateFunctionType(String8 key, U64 gen, U64 *requested_gen, B32 *retry_out);
typedef AC_Artifact AC_CreateFunctionType(String8 key, B32 *cancel_signal, B32 *retry_out);
typedef void AC_DestroyFunctionType(AC_Artifact artifact);
typedef U32 AC_Flags;
@@ -37,6 +37,7 @@ struct AC_ArtifactParams
U64 gen;
U64 evict_threshold_us;
B32 *stale_out;
B32 *cancel_signal;
AC_Flags flags;
};
@@ -48,7 +49,7 @@ struct AC_Request
{
String8 key;
U64 gen;
U64 *last_requested_gen;
B32 *cancel_signal;
AC_CreateFunctionType *create;
};
@@ -138,6 +139,11 @@ global AC_Shared *ac_shared = 0;
internal void ac_init(void);
////////////////////////////////
//~ rjf: Helpers
internal B32 ac_cancelled(void);
////////////////////////////////
//~ rjf: Cache Lookups