1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-04 17:43:45 +00:00

1. Fixed compiler warnings

2. Updated thread cleanup/finalizer logic to rely on ctxd if necessary
This commit is contained in:
Bryan Roe
2020-04-20 17:01:53 -07:00
parent 0c6db0b2a6
commit 71d4b1edca
5 changed files with 48 additions and 8 deletions

View File

@@ -969,9 +969,7 @@ duk_ret_t ILibDuktape_GenericMarshal_MethodInvokeAsync_abort(duk_context *ctx)
// We can gracefully exit this thread
data->abort = 1;
sem_post(workAvailable);
#ifdef WIN32
ILibThread_Join(workerThread);
#endif
}
else
{
@@ -1018,13 +1016,15 @@ duk_ret_t ILibDuktape_GenericMarshal_MethodInvokeAsync_dataFinalizer(duk_context
void *workerThread = data->workerThread;
data->abort = 1;
sem_post(&(data->workAvailable));
#ifdef WIN32
sem_post(workAvailable);
ILibThread_Join(workerThread);
#endif
}
else
{
if (duk_ctx_shutting_down(ctx))
{
ILibLinkedList_AddTail(duk_ctx_context_data(ctx)->threads, data->workerThread);
}
data->abort = 1;
}
}