mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-07-20 00:33:44 -04:00
update core/adapter/syscall/src/hdf_syscall_adapter.c.
This commit is contained in:
@@ -209,6 +209,14 @@ static int32_t AssignPfds(struct HdfDevListenerThread *thread, struct pollfd **p
|
||||
return pfdCount;
|
||||
}
|
||||
|
||||
static void HdfDevListenerThreadFree(struct HdfDevListenerThread *thread)
|
||||
{
|
||||
OsalMutexDestroy(&thread->mutex);
|
||||
OsalMemFree(thread->pfds);
|
||||
OsalThreadDestroy(&thread->thread);
|
||||
OsalMemFree(thread);
|
||||
}
|
||||
|
||||
#define POLL_WAIT_TIME_MS 100
|
||||
static int32_t HdfDevEventListenTask(void *para)
|
||||
{
|
||||
@@ -255,10 +263,7 @@ exit:
|
||||
|
||||
if (thread->shouldStop) {
|
||||
/* exit due to async exit call, should free thread struct */
|
||||
OsalMutexDestroy(&thread->mutex);
|
||||
OsalThreadDestroy(&thread->thread);
|
||||
OsalMemFree(thread->pfds);
|
||||
OsalMemFree(thread);
|
||||
HdfDevListenerThreadFree(thread);
|
||||
}
|
||||
|
||||
return HDF_SUCCESS;
|
||||
@@ -575,14 +580,6 @@ static void HdfListenThreadPollDel(struct HdfDevListenerThread *thread, struct
|
||||
OsalMutexUnlock(&thread->mutex);
|
||||
}
|
||||
|
||||
static void HdfDevListenerThreadFree(struct HdfDevListenerThread *thread)
|
||||
{
|
||||
OsalMutexDestroy(&thread->mutex);
|
||||
OsalMemFree(thread->pfds);
|
||||
OsalThreadDestroy(&thread->thread);
|
||||
OsalMemFree(thread);
|
||||
}
|
||||
|
||||
static void HdfDevListenerThreadDestroy(struct HdfDevListenerThread *thread)
|
||||
{
|
||||
if (thread == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user