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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user