Release ignored error contexts
This commit is contained in:
@@ -90,9 +90,6 @@ static void one_checkout(akerr_ThreadArg *arg)
|
||||
static void *pool_body(void *raw)
|
||||
{
|
||||
akerr_ThreadArg *arg = raw;
|
||||
char expected[64];
|
||||
|
||||
snprintf(expected, sizeof(expected), "ignored by thread %d", arg->id);
|
||||
pthread_barrier_wait(arg->barrier);
|
||||
|
||||
for ( int i = 0; i < ITERATIONS; i++ ) {
|
||||
@@ -100,17 +97,10 @@ static void *pool_body(void *raw)
|
||||
one_checkout(arg);
|
||||
}
|
||||
|
||||
/* An ignored error is a fact about the thread that ignored it: each thread
|
||||
* must see its own, not the last one any thread swallowed. */
|
||||
/* IGNORE's scratch pointer is thread-local while logging and cleared after
|
||||
* release. Concurrent ignored errors must all return their pool slots. */
|
||||
IGNORE(ignorable(arg));
|
||||
AKERR_TCHECK(arg, __akerr_last_ignored != NULL);
|
||||
if ( __akerr_last_ignored != NULL ) {
|
||||
AKERR_TCHECK(arg, __akerr_last_ignored->status == AKERR_IO);
|
||||
AKERR_TCHECK(arg, strcmp(__akerr_last_ignored->message, expected) == 0);
|
||||
}
|
||||
/* IGNORE keeps the reference by design; hand it back so the pool is empty
|
||||
* at the end of the test. */
|
||||
RELEASE_ERROR(__akerr_last_ignored);
|
||||
AKERR_TCHECK(arg, __akerr_last_ignored == NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user